RE: [picocontainer-dev] comments on injection
Jörg Schaible <[email protected]>
| Newsgroups | gmane.comp.java.picocontainer.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Erik,
________________________________
From: Putrycz, Erik
Sent: Thursday, May 31, 2007 8:48 PM
Subject: [picocontainer-dev] comments on injection
I moved most of my project to pico 2 and was hoping to use the new injection but currently the only injection available is on methods...
I'm not very keen on the method injection, it creates IMO often too much verbose code whereas a member injection is quicker to write. Often I don't even need a getter and setter...
However I think both would be nice to have.
Any objection on adding member injection?
I also think I figured out a way to inject members of an existing object without modifying the container. I'll see how that turns out.
________________________________
This is IMHO known as Field Dependency Injection. Thomas Heller once implemented it in a bracnch, but it was mixed with Java 5 features, therefore it never made it into the core. Go on, such an impl is welcome.
________________________________
Last comment... I know this is very unpopular here but I'd be nice if there was some kind of hook in Pico to be able to setup auto registration of classes. Somekind of callback on getComponent - when not found - would be nice.
________________________________
This should be part of the Monitor.
- Jörg
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email