Re: [picocontainer-dev] Simplify PIcoConatienr interface/ Refactor parameter[s]
Konstantin Priblouda <kpriblouda-/[email protected]>
| Newsgroups | gmane.comp.java.picocontainer.devel |
|---|---|
| Message-ID | <[email protected]> |
--- Paul Hammant <[email protected]> wrote: > Its most definitely a hack - am interested in an > elegant successor. > > The ParameterName interface is to allow a lazy > lookup of a parameter > name (arguably costly) without affecting > performance. The majority > case for Pico will be looking up by type (as > always), the minority > use will be by parameter name. It looks to ma, that scopes / phases are mixed here. specifying parameter lookup etc ( i.e. wiring ) definitely belongs to composition phase. Looking up component shall be comlpetely agnostic of container buildup (and produce comparable results for subsequent invocations). What is going to happen on second subsequent invocation? If component is already instantiated and cached - additional parameters will be not honored. ( and this is not transparent to user ) And method in question belongs to retrieval of component adapter in question. Shall it be some proxy? Will this adapter be affected by name hint? Will it affect adapter resolution? As for lazy lookup - to profit from this, ParameterName shall be reused somewhere. Who is going to reuse this? Typically ParameterName would refer to certain ( the same ) adapter - so why not keep adapter itself? > Incidentally, we need to put in the binding > annotations thing too, > sooner or later. It's in the same space: > > class CompA { > public CompA(@JdbcUserName String name, > @JdbcPassword String > password) { } > } > > Dreadfully verbose, but definitely something a > versatile embeddable > container should do. Who is going to define such annotations? If we are speaking of hints ( for lack of param names ) there shall be generic annotation to do this... ( what versatiliy we are speaking of otherwise? ) regards, ----[ Konstantin Pribluda http://www.pribluda.de ]---------------- JTec quality components: http://www.pribluda.de/projects/ ____________________________________________________________________________________ Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now. http://mobile.yahoo.com/sports;_ylt=At9_qDKvtAbMuh1G1SQtBI7ntAcJ --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email