Hi all. I want to build a component that requires database connectivity (NexusDB) at design time (as well as runtime). I’ve implemented an interface IBeehiveDatabase that works incredibly well as follows (project file) at runtime.
...
Beehive.Interfaces,
Spring.Container,
Spring.Services,
Beehive.Database in '..Beehive.Database.pas', { implements IBeehiveDatabase }
...
var
FDatabase: IBeehiveDatabase;
...
begin
GlobalContainer.Build;
Application.Initialize;
FDatabase := ServiceLocator.GetService<IBeehiveDatabase>;
if not FDatabase.Connect(['beehiveclient', 'beehiveglobal']) then
Application.Terminate;
The component I want to build is for retrieving SVG data. This component may use the service locator internally to get IBeehiveDatabase or it may be passed in from somewhere else. Wherever it comes from, where or how do I execute GlobalContainer.Build at designtime?
Thanks, Gerard Hook