Forum Post: IoC, InjectABL

  • Thread starter Thread starter agent_008_nl
  • Start date Start date
Status
Not open for further replies.
A

agent_008_nl

Guest
Using the injectABL module made by Peter Judge. https://community.progress.com/technicalusers/w/openedgecloudarcade/998.oeri-dependency-injection-container-injectabl.aspx . Some commercials for this great work below, but first this: It would be great if the documentation of injectABL (see the link at the top) would get some attention, so that it becomes more appealing to those new to the principles. It's worth the product (talking from experience, I use it for a couple of years now), and I think needed for acceptance by new programmers having to work with frameworks that makes use of it (I experience this problem myself at least with programmers starting with the framework I built - starting with aetf - and of course had a learningcurve myself when I started using it). We now, with injectABL, have a module to manage lifespan of and dependencies between objects, in a highly configurable way. On IoC: http://martinfowler.com/articles/injection.html We can for example avoid those handy singletons (one running instance per session) that you instantiate via a static, making it possible to use the class without first having to new (for example http://knowledgebase.progress.com/articles/Article/P159909). Why is such a singleton to be avoided? http://blogs.msdn.com/b/scottdensmore/archive/2004/05/25/140827.aspx As Fowler says (see link above) IoC has some pros above the factories, from the link above: "IOC/DI is a complete ecosystem of domain objects and services in and of itself. It sets everything up for you in the way you specify. Your domain objects and services are constructed by the container, and do not construct themselves: they therefore do not have any dependencies on the container or on any factories. IOC/DI permits an extremely high degree of configurability, with all the configuration in a single place (construction of the container) at the topmost layer of your application (the GUI, the Web front-end). Factory abstracts away some of the construction of your domain objects and services. But domain objects and services are still responsible for figuring out how to construct themselves and how to get all the things they depend on. All these "active" dependencies filter all the way through all the layers in your application. There is no single place to go to configure everything." Some interesting remarks about the use of IoC / DI: http://www.devtrends.co.uk/blog/how-not-to-do-dependency-injection-the-static-or-singleton-container -- Kind regards, Stefan Houtzager Houtzager ICT consultancy & development www.linkedin.com/in/stefanhoutzager

Continue reading...
 
Status
Not open for further replies.
Back
Top