> -----Original Message----- > From: Stephen McConnell [mailto:[EMAIL PROTECTED] > Sent: Friday, March 12, 2004 7:37 PM > > Olaf Bergner wrote: > >>-----Original Message----- > >>From: Stephen McConnell [mailto:[EMAIL PROTECTED] > >>Sent: Friday, March 12, 2004 10:29 AM > >> > >>A new binary snapshot of Merlin is now available. The snapshot includes > >>support for the injection of classic avalon lifecycle artifacts via > >>constructor (including Logger, Configuration, Parameters, Context, > >>ServiceManager). > >> > > Though I do appreciate the hard work that went into this > feature I fail to > > see a need for it. Maybe it's just me but I always felt that > > constructor-based dependency injection was so very ... clumsy. It simply > > doesn't feel right, putting so much logic into a mere > constructor. But then > > again I have never been a fan of PicoContainer. No offence > intended, but I > > for one will stick with the classic Avalon way. > > Hi Olaf: > > The stuff that has been added is *not* Pico style dependency injection. > I agree - the pico style is clumsy and opens the door to lots of > inconsistencies. Instead this is classic Avalon lifecycle artifact > injection - which means we preserve 100% of the Avalon semantics. The > only change this introduces is an alternative delivery mechanism. For > example this enables a component author to choose between Serviceable as > a delivery mechanism as opposed to ServiceManager as a constructor > argument as an alternative delivery mechanism. > > The main benefits are: > > * code simplification for the component writer > > * ability to use final state members (which adds improved > compile type checking and reduced memory consumption) > > * ability to collapse all lifecycle setup into the constructor > phase which in turn eliminates the possibility of errors > arising from not declaring that a component implements > a particular lifecycle interface >
Hi Stephen, I will gladly admit that you have some valid points here. And having the choice between two equal alternatives might be a value in itself. That is, as long as we won't get caught in that abhorrent trap that's called "There's more than one way to do it", which makes Perl code such an ugly mess (IMHO). Anyway, it seems like an experiment worth making, so let's see where it gets us. Cheers, Olaf --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
