2015-01-05 21:44 GMT-03:00 Marcos Douglas <[email protected]>: > On Mon, Jan 5, 2015 at 6:07 PM, luiz americo pereira camara > > > > I created a IoC Container that can be found at > > > https://code.google.com/p/luipack/source/browse/trunk/luicomponents/luiioccontainer.pas > > . It has no dependencies. > > > > > So in the end, i use the service locator and have plans to use Property > > Injection pattern > > > > BTW: Custom Attributes support would help to have a nicer Property > Injection > > implementation > > Interesting. > Could you give us some example how this class works? > > There's a demo in demos/ioccontainer
In a working project i use a IPresentationManager https://code.google.com/p/luipack/source/browse/trunk/luicontrols/presentationmanager.pas#36 When a class needs to use it, resolves from a TIoCContainer (Service Locator pattern). The global variable and concrete class are not exposed. In the other hand depends of the IoCContainer. I have plans to switch to a Property Injection pattern that helps to decouple a bit more. Luiz
-- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
