Quantcast
Channel: Delphi – The Wiert Corner – irregular stream of stuff
Viewing all articles
Browse latest Browse all 1445

does anyone know of any Spring.Container examples (preferably non trivial) th…

$
0
0

Via [WayBack] does anyone know of any Spring.Container examples (preferably non trivial) that show how to build an app with a container just referenced from the Compo… – Russell Weetch – Google+:

Stefan Glienke:

The principle of having a composition root has nothing to do with a particular DI container. Its what you eventually get when following the principle if DI: ask for dependencies – don’t create or look for them yourself (aka service locator).

You did not mention it but I guess you mean a VCL application – now the design of the VCL is not particularly built with DI in mind and thus it can be a bit tricky to hook up the application MainForm to the container to get it injected everything. However there are several examples how to achieve that (mainly by using DelegateTo and doing the Application.CreateForm there).

An example explaining this is for instance in [WayBack] How to initialize main application form in Spring4D GlobalContainer?

Many more can be found through Spring4d DelegateTo and Spring4d DelegateTo CreateForm and

–jeroen


Viewing all articles
Browse latest Browse all 1445

Trending Articles