Forum Post: RE: do you inject ?

  • Thread starter Thread starter Peter Judge
  • Start date Start date
Status
Not open for further replies.
P

Peter Judge

Guest
There are, of course, some cases where you are going to instantiate your own objects. Depends what those objects are, though. If the temp-table contains something which is an implementation of an instance, then you should use DI for resolving that interface type into an object, and your use of a tight loop might be wrong. -- peter From: jmls [mailto:bounce-jmls@community.progress.com] Sent: Thursday, 16 October, 2014 15:47 To: TU.OE.Development@community.progress.com Subject: RE: [Technical Users - OE Development] do you inject ? RE: do you inject ? Reply by jmls Yeah yeah. Don't get too happy.. I'm still not entirely sure ☺ Answer me this.. If a method in a class is looping through, creating a temp table record and storing an instance of an object, surely the method must create it's own instance of the object, as there are multiple instances. In this case the instance cannot be injected into the class. So, what is? On 16 Oct 2014 20:20, "Peter Judge" bounce-pjudge@community.progress.com wrote: RE: do you inject ? Reply by Peter Judge Stefan's link might also be a little outdated. There's a new version of the Code Share page on here - community.progress.com/.../default.aspx - which links to it. Direct link is github.com/.../InjectABL . The github version has been updated to use some of the libraries in 11.4 (stuff which moved from AutoEdge into OE). IoC containers all have the concept of a Composition Root, which is basically the top-level point at which the injection starts. Mark Seeman - who is a huge fan of DI in the C#/.NET world - has a good intro at http://blog.ploeh.dk/2011/07/28/CompositionRoot/ . The point of the composition root is that it's the only place in the app that actually knows about the DI/IoC container. In AutoEdge it's in 1 file - start_session.p that is called in 2 places: on the client ABL code, from the start_ui.p procedure, and on AppServer startup, in as_startup.p (the startup event procedure). I have proposed talks on the use of interfaces and "Composing complex applications" for a few Exchanges and PUG/Challenges, without luck. There are, after all, only so many timeslots available. I am always happy to talk about this stuff though. And even happier that Julian has finally seen the light on DI ;) regards, -- peter Stop receiving emails on this subject. Flag this post as spam/abuse. Stop receiving emails on this subject. Flag this post as spam/abuse.

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