Re: [picocontainer-dev] Config , Properties and API struggle

Paul Hammant <[email protected]>
Newsgroups gmane.comp.java.picocontainer.devel
Message-ID <[email protected]>
> after some recapitulation I think that introducing new
> kind of parameter would be the smallest evil
> ( this would hunt CAs by key only - external config
> entity has to be explicit - and try to convert
> string from it into object - this can be made
> configurable )
> Such parameter will be able to work with attributed PC
> (which could be simplified to just register
> string/string). on top of APC we could build
> different varieties - filled with string array,
> properties or off commons-cli or whatever else.
> ( and addConfig() becomes obsolete )


I fear that would not be elegant in use dude.  I almost never use the  
current parameter design now.

What I will commit later for Groovy will be ..

                 nano = builder.container {
                    config(key:'foo', value:'one')
                    config(key:'bar', value:'two')
                    component(class:NeedsString.class, properties: 
[ USE_NAMES ])
                 }

Following that I may do ..

                 nano = builder.container {
                    config(key:'foo', value:'one')
                    config(key:'bar', value:'two')
                    properties( USE_NAMES ) {
                        component(class:NeedsString.class)
                    }
                 }

(NeedsString has a ctor with a single String param-name of 'foo')

How would yours look in Groovy ?

- Paul

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.