Recommended CDI tool, Blueprint / DS / Dependency Management / Low level API?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Recommended CDI tool, Blueprint / DS / Dependency Management / Low level API?

Guenther Schmidt

Hello All,


what is the recommended CDI tool?


Should I use

  • the low level API (BundleActivator),
  • Felix Dependency Management,
  • Blueprint,
  • or annotation based DS?

I'd rather not use the first two options, i don't want to buy into anything non-standard.


Guenther

Reply | Threaded
Open this post in threaded view
|

Re: Recommended CDI tool, Blueprint / DS / Dependency Management / Low level API?

cschneider
I started with blueprint but today I am almost exclusively using declarative services. DS is a lot more dynamic than blueprint. So it causes less issues in OSGi as it adapts better to changes. DS is a bit of a learning curve but is very well worth the effort. 

One isue with DS is that it does not have special support for JPA or CXF. 
For JPA you will not be able to use the @Transactional annotation but there are good solutions for it like the Aries JPA JPATemplate or Aries tx-control. For CXF you can use either CXF-DOSGi or Aries JAX-RS whiteboard.

You can also find some hints about DS here: 

Christian

2017-12-17 21:59 GMT+01:00 Guenther Schmidt <[hidden email]>:

Hello All,


what is the recommended CDI tool?


Should I use

  • the low level API (BundleActivator),
  • Felix Dependency Management,
  • Blueprint,
  • or annotation based DS?

I'd rather not use the first two options, i don't want to buy into anything non-standard.


Guenther




--
--
Christian Schneider

http://www.liquid-reality.de

Computer Scientist

Reply | Threaded
Open this post in threaded view
|

Re: Recommended CDI tool, Blueprint / DS / Dependency Management / Low level API?

jbonofre
In reply to this post by Guenther Schmidt
Hi,

Not easy question as it depends what you want to do ;)

Blueprint has the proxy (convenient), DS is more dynamic and closer to OSGi
(good), "pure" OSGi is always working (but lot of boilerplate code).

My experience is for an end-user application, DS is interesting. For more
framework/low level application, OSGi can be a serious candidate.

I would say, try DS/SCR first and if you have some limitation, you can mix with
blueprint.

Regards
JB

On 12/17/2017 09:59 PM, Guenther Schmidt wrote:

> Hello All,
>
>
> what is the recommended CDI tool?
>
>
> Should I use
>
>   * the low level API (BundleActivator),
>   * Felix Dependency Management,
>   * Blueprint,
>   * or annotation based DS?
>
> I'd rather not use the first two options, i don't want to buy into anything
> non-standard.
>
>
> Guenther
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: Recommended CDI tool, Blueprint / DS / Dependency Management / Low level API?

Tim Ward-2
Hi,

I would say, try DS/SCR first and if you have some limitation, you can mix with blueprint.

I definitely agree with the general statement that people should start with DS. Using the low level API correctly is *hard*, and many of the examples using it are bad. In the application space there are are few, if any, reasons to choose the low-level API. One other point in favour of DS is that it gets regularly updated in the OSGi specifications. Blueprint may be a standard, but the standard hasn’t been updated to cover configuration, prototype scoped services, or any new OSGi features from the last five years.

The other good point that JB is making (which may have gone unnoticed) is that you don’t have to choose the same injection container for all of your bundles. Because all bundles should interact using OSGi services you can use different injection containers in different bundles and know that those bundles will still work together - the way that they are wired together internally is hidden.

Regards,

Tim Ward

OSGi IoT EG chair



On 18 Dec 2017, at 06:56, Jean-Baptiste Onofré <[hidden email]> wrote:

Hi,

Not easy question as it depends what you want to do ;)

Blueprint has the proxy (convenient), DS is more dynamic and closer to OSGi (good), "pure" OSGi is always working (but lot of boilerplate code).

My experience is for an end-user application, DS is interesting. For more framework/low level application, OSGi can be a serious candidate.

I would say, try DS/SCR first and if you have some limitation, you can mix with blueprint.

Regards
JB

On 12/17/2017 09:59 PM, Guenther Schmidt wrote:
Hello All,
what is the recommended CDI tool?
Should I use
 * the low level API (BundleActivator),
 * Felix Dependency Management,
 * Blueprint,
 * or annotation based DS?
I'd rather not use the first two options, i don't want to buy into anything non-standard.
Guenther

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com