felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher BROWN <br...@reflexe.fr>
Subject Re: declarative Services
Date Mon, 03 Jun 2013 09:05:35 GMT
Neil,

Could the declarative services of OSGi fit well with the module system for
project Jigsaw and the enhanced ServiceLoader API ?
http://openjdk.java.net/projects/jigsaw/doc/draft-java-module-system-requirements-12#services

Obviously, I'm well aware that Jigsaw is taking a long time to implement
over at Oracle and that there are (were) some "political" debates... Was
just wondering from a practical point of view if there was any information
about these features.

--
Christopher


On 2 June 2013 13:45, Neil Bartlett <njbartlett@gmail.com> wrote:

> Christopher,
>
> Not really; a DS component can do literally everything that a bundle
> activator can do. Additionally you can have more than one of them per
> bundle, and you have much easier access to services and configuration.
>
> Regards
> Neil
>
> On Sun, Jun 2, 2013 at 8:54 AM, Christopher BROWN <brown@reflexe.fr>
> wrote:
>
> > Hi Peter,
> >
> > Isn't that a bit like asserting that you only ever need functional
> > programming, and not OOP or any other imperative style?
> >
> > I would tend to agree with your assertion, where DS is the best fit
> > solution for most use cases, but having the bundle activator is nice in
> > order to handle edge cases.
> >
> > --
> > Christopher
> >
> >
> >
> > On 1 June 2013 11:27, Peter Kriens <peter.kriens@aqute.biz> wrote:
> >
> > > If I had to start over with the design of OSGi there would be no bundle
> > > activator, just DS components ... The activator was a mistake since it
> > is a
> > > singleton and I now sometimes wonder what we are smoking, forcing
> people
> > to
> > > handle their own service dependencies. DS's support services, service
> > > factories, and more as well as fully handling service dependencies
> makes
> > > services as lightweight as classes. With the DS annotations you can
> turn
> > ay
> > > class into a service (factory) whenever you want, not requiring any
> extra
> > > setup. I found it amazing how light weight services became once I could
> > do
> > > this.
> > >
> > > You can control the life cycle of the component with config admin using
> > > managed service (factories). Config admin can define/override service
> > > properties and define which service dependencies are bound by setting
> the
> > > target filter.
> > >
> > > With DS you do not need the dependency manager since DS handles deps
> for
> > > you.
> > >
> > > Again, OSGi was not complete until DS was specified.
> > >
> > > Kind regards,
> > >
> > >     Peters Kriens
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message