Re: [picocontainer-dev] annotations and comments on Pico2

Philipp Meier <[email protected]>
Newsgroups gmane.comp.java.picocontainer.devel
Message-ID <[email protected]>
Konstantin Priblouda wrote:
> --- "Putrycz, Erik" <[email protected]>
> wrote:
> 
>> Konstantin, not sure what you mean by
>> "unflexibility". And do you mean
>> you rather would not have any annotations in the
>> container?
> 
> I have 2 main objections to use of annotation for
> wiring configuration
> 
> 1. they introduce dependency on container ( which is 
> kind of uncool ) 

I think adding a dependency on the container is bad, too. Using 
annotations to model component dependencies is usefull in some cases. So 
I suggest creating annotation types like "Inject" or "Singleton" or 
"ThreadLocal" in the domain model and let pico provide a simple api/spi 
to make us of this annotations.

The simples form would be sth. like

pico.mapAnnotationToCA(com.acme.model.ThreadLocal.class, 
ThreadLocalCA.class)

> 2. they are compiled into classes and can not be
> changed afterwards. This can be solved by second
> externalisable configuration system - and what value 
> do they have afterwards? 

Using annotations to wire components together is often fine. Using 
annotations for configuration is mostly bad. (my two cents).

-billy

-- 
Philipp Meier - [email protected]

A: Because it breaks the logical sequence of discussion
Q: Why is top posting bad?

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