[picocontainer-dev] Thoughts about parameters / simplification of interface
Konstantin Priblouda <kpriblouda-/[email protected]>
| Newsgroups | gmane.comp.java.picocontainer.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi all,
Well, now we have 3 types of parameters ( constant ,
component and config ) - and they are present on
interface.
Paul points, that it is somehow uncool to pass all the
"newed" parameters to
MPC.addComponent(key,compOrInst,params...)
and there shall be a better way to do this.
It just came to my mind while awaking from morning
coma
( our train drivers are on strike, so I have to
carpool
with some really early birds ;) )
thet we can as well sack those parameters from
interface, and use just objects instead with following
logic:
null: resolve by type
not null:
try as key
if exists and type match -> ComponentParameter
if exists and type is string -> ConfigParameter (
try to convert)
if not exists
if type match treat as constant parameter
if not and string try to convert (like config
paramater)
Null parameter array would mean greediest staisfiable,
empty array - default constructor.
Thus signature becomes:
MPC.addComponent(key,compOrInst,Object...)
Of course we shall keep component adapter construction
with explicit specification of parameters.
WDYT?
----[ Konstantin Pribluda http://www.pribluda.de ]----------------
JTec quality components: http://www.pribluda.de/projects/
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email