Em Tue, 22 Dec 2009 05:20:16 -0200, Igor Drobiazko
<[email protected]> escreveu:
I had a short look into how to integrate the JSR-330 and I fear it is not
possible to make the intergation inside a 3rd-party library. You have to
make some changes inside tapestry-ioc when you implement the integration.
I think JSR 330 is small enough for we to try to implement it instead of
relying in other libraries. And we don't want to lose distributed
configuration when declaring a JSR 330 bean, of course. ;)
These are simple examples I realized after trying to run the tck of the
JSR-330:
- javax.inject.Inject may be applied to static members.
- in tapestry-ioc only public constructors can be used for injection, in
JSR-330 not.
I guess this additions would not be difficult to do.
- in tck I saw a line of code in which an interface is downcasted to its
implementation. This will not work with tapestry-ioc because of the
proxies.
Tapestry-IoC proxies could have some improvements. They lose the
annotations in the service implementation methods, so implementing
anything that relies on them (like Spring-TX's and EJB's @Transactional)
seems impossibile now. One possible solution is to create proxies as
subclasses (almost like you would implement a hand-written decorator) and
copy the annotations to the proxy methods. I have not tried to implement
it yet, so I don't know if this would work.
With these few examples it is obvious that the integration requires some
ioc patches if you want to pass the tck.
There are some more stuff to implement:
* The Provider<T> interface injection:
http://atinject.googlecode.com/svn/trunk/javadoc/javax/inject/Provider.html
* Support for the Qualifier annotation.
--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da
Informação Ltda.
http://www.arsmachina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]