On 18.03.2016 13:07, Charlie Mordant wrote:
Let introduce an other player: Pax-CDI!
It is fully annotation based and a well known JavaEE standard with
some additional annotations to deal with OSGi services.
I really prefer this way for development.
I'm used to deal with these 3 technologies and here are the case where
I use one or another:
* I'm using blueprint when:
* * I would do spring xml binding to third parties classes: e.g.
declaring ciphers or crypto algorthms binding... In this case
Annotation-based configurations comes with some boilerplate code.
* * When dealing with JPA/JTA: Aries Jpa and Aries transactions are
really nice OSGi integration stacks and they're blueprint based.
* * When I dealing with some init/destroy-methods in a bundle fragment.
* I'm using Declarative service when I have to code some low-level
modules (all modules where the stack shouldn't need BP or CDI): DS is
lighter than its concurrent.
* I'm using Pax-CDI everywhere else: its really a pleasure to just add
@Inject @OsgiService on a bean attribute.
You can also mix CDI and blueprint using the blueprint-maven-plugin. It
allows to use the cdi annotations even when you also need to specify
parts of the blueprint by hand.
Of course the annotations are then parsed at build time only and you
only have a subset of CDI but it is better than hand coding xml.
Christian
--
Christian Schneider
http://www.liquid-reality.de
Open Source Architect
http://www.talend.com