Nicola Ken Barozzi wrote:


http://nanocontainer.codehaus.org/team-list.html http://www.picocontainer.org/team-list.html

Now I know what Paul has been doing! :-)

What do you guys think about the Type1,2,3 Container explanation?
I don't buy it ;-P

http://www.picocontainer.org/introduction.html


The site you referenced presents an argument that there are 3 types of IOC. It continues to provide examples. I would argue that none of the examples represent types of IOC. In fact I would suggest that this is presenting some historical information on the subject of "mechanisms" for dependency declaration.


I would agree that there are different mechanisms that can be chosen for a component to declare dependencies.

 Approach 1: using meta information
   - via packaged meta-info

 Approach 2: using javadoc tags
   - combined with a preprocessor to
     generate the packaged meta-info
   - i.e. is simply a layer above (1)

 Approach 3: using the constructor signature
   - class sequence corresponds to typed dependencies with roles
   - role corresponds to ordered position of a type in the constructor

So at the end of the day you end up considering the approach to dependency declaration and weighing expressiveness with simplicity. For lightweight components, the introspection approach has benefits in that you gain compile time checking (at the expense of tighter coupling). However, this comes at a price: you loose the benefits of optional dependencies (although this could be addressed by allowed multiple constructor signatures), you loose the ability to control service export, you loose certain benefits or orderly lifecycle phase management, and you loose the ability to declare lifestyle.

Now - an interesting question - is the constructor approach incompatible with the Avalon approach. My conclusion is that it is not. One could consider the automatic assembly of objects based on a Constructor as part of a standard component contract.

Cheers, Steve.


--


Stephen J. McConnell
mailto:[EMAIL PROTECTED]
http://www.osm.net

Sent via James running under Merlin as an NT service.
http://avalon.apache.org/sandbox/merlin




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to