RE: [picocontainer-dev] config parameter - work started

Jörg Schaible <[email protected]>
Newsgroups gmane.comp.java.picocontainer.devel
Message-ID <[email protected]>
Konstantin Priblouda wrote on Tuesday, September 11, 2007 8:42 AM:

> --- Jörg Schaible <[email protected]> wrote:
> 
>>> I reused xstream SingleValueConverters (that's why it
>>> goes into nanocontainer), but resident xstream gurus
>>> could find better way to configure mapping from class to
>>> converter.
>> 
>> Just one side-note: You currently create a Map with Class ==> SVC
>> mapping. However, some converters handle the same types. This is
>> especially true for the ISO8601 types.
> 
> Well, it's just a first try - maybe I do not fully
> grok
> how xstream works. 

XStream simply does not register all converters in the package. If you need ISO8601 formats, you can register them yourself and they take precedence.

> Of course I would prefer some
> xsrtream mapper.

Well, the approach is interesting, but we're back at configuration ... which converters should be used (and some of them can be configured). We might use some dependency injection framework ... <g> SCNR

>>> BTW, ToStringConverter couldbe improved (maybe)
>>> to be generic - not bound to concrete class.
>> 
>> It might not be a good idea to use this converter
>> for any class that
>> declares a ctor with a String argument ... you might
>> get some surprises :)
> 
> Sure ;) but this is the way it is done in xstream ;)

The converter is not used by default. It's simply there for your convenience if you have a class that matches this pattern. Therefore it is explicitly tied to a class. And we're back to configuration again ...

> Anyway, I'm assuming that if you specify dependency
> config item of some type, your shall know what you are
> doing  - config stuff shall be explicit.
> 
> After some thinking ( gosh, it's usefull ;) )  I came
> with idea to use it as fallback when nothing else
> found.

Well, I think the whole purpose of parameters is to assign special values as destinct "dependencies". This is what components separates parameters in terms of "dependency". While the idea to use XStream's single value converters is nice, it is possibly more sophisticated than necessary.

- Jörg

---------------------------------------------------------------------
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.