Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Using @annotations to define Declarative Services components(Discussion of future plans for defining ds components via java annotations)
Using @annotations to define Declarative Services components [message #766496] Thu, 15 December 2011 17:13 Go to next message
Darren Janeczek is currently offline Darren Janeczek
Messages: 11
Registered: October 2011
Junior Member
Hello all, I'd like to start a discussion here. My first glance through the search engine here didn't seem to have anything, so I hope I'm not being too redundant.

I am curious if there has been much interest, discussion, future plans, or progress in implementing a definition for declarative service components via @annotations in Equinox.

It strikes me as a very natural and sugary way to express ds components, and offers the added joy of a single centralized definition. Would officially supporting and implementing this fit within the goals of the equinox.ds project?

And would it be reasonable to pursue an approach that processes these annotations at run-time vs pre-processing them into xml at build-time?

Thoughts?

Here are some similar approaches:
http://felix.apache.org/site/scr-annotations.html
http://code.google.com/a/eclipselabs.org/p/org-eclipselabs-osgi-ds-annotations/
http://www.toedter.com/blog/?p=46

[Updated on: Thu, 15 December 2011 17:17]

Report message to a moderator

Re: Using @annotations to define Declarative Services components [message #766746 is a reply to message #766496] Fri, 16 December 2011 05:50 Go to previous messageGo to next message
Ivan Larionov is currently offline Ivan Larionov
Messages: 37
Registered: July 2009
Member
Hi Darren,

Bnd tools for Eclipse seem to be able to generate component definition
xml from annotations.

Since you have asked for thoughts...

With reference to your last statement, in my opinion there are some
reasons why annotations have not been considered.

Firstly, deferred loading of classes is constantly mentioned in the OSGi
spec. And processing annotation in runtime would involve component class
discovery which leads to class loading.

Secondly, OSGi may run in java 1.4 jre where there are no annotations.
Though it seems to be a wild guess as I do not know which version of
java the current OSGi spec is aiming at.

Regards,
Ivan

On 16.12.2011 0:13, Darren Janeczek wrote:
> Hello all, I'd like to start a discussion here. My first glance through
> the search engine here didn't seem to have anything, so I hope I'm not
> being too redundant.
>
> I am curious if there has been much interest, discussion, future plans,
> or progress in implementing a definition for declarative service
> components via @annotations in Equinox.
>
> It strikes me as a very natural and sugary way to express ds components,
> and offers the added joy of a single centralized definition. Would
> officially supporting and implementing this fit within the goals of the
> equinox.ds project?
>
> And would it be reasonable to have an approach that processes these
> annotations at run-time vs pre-processing them into xml at build-time?
>
> Thoughts?
>
> Here are some similar approaches:
> http://felix.apache.org/site/scr-annotations.html
> http://code.google.com/a/eclipselabs.org/p/org-eclipselabs-osgi-ds-annotations/
>
> http://www.toedter.com/blog/?p=46
Re: Using @annotations to define Declarative Services components [message #766822 is a reply to message #766746] Fri, 16 December 2011 08:47 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas Watson
Messages: 420
Registered: July 2009
Senior Member
To add to Ivan's comments. The next revision of the OSGi specification will be standardizing annotations for DS, but they will be compile time annotations which result in the appropriate generation of the DS component XML file for the bundle which is being build, just like the current bnd tools does today for the felix defined scr annotations. Such support belongs in the DS tooling PDE offers. If you are interested in contributing I suggest you ask on the PDE forum or dev mailing list.

Tom.
Re: Using @annotations to define Declarative Services components [message #766910 is a reply to message #766822] Fri, 16 December 2011 11:23 Go to previous messageGo to next message
Darren Janeczek is currently offline Darren Janeczek
Messages: 11
Registered: October 2011
Junior Member
Thank you both. This makes it very clear why a run-time approach shouldn't be a priority.
I'm going to investigate your suggestion further, Tom.


Thanks,
Darren.
Re: Using @annotations to define Declarative Services components [message #766933 is a reply to message #766910] Fri, 16 December 2011 12:25 Go to previous messageGo to next message
Darren Janeczek is currently offline Darren Janeczek
Messages: 11
Registered: October 2011
Junior Member
Here's an interesting blog which further discusses the idea.

http://tux2323.blogspot.com/2011/10/osgi-rfc-0172-declarative-services.html
Re: Using @annotations to define Declarative Services components [message #766940 is a reply to message #766933] Fri, 16 December 2011 12:42 Go to previous message
Darren Janeczek is currently offline Darren Janeczek
Messages: 11
Registered: October 2011
Junior Member
Thanks also for mentioning bndtools;

http://bndtools.org/

It looks very exciting for a whole range of additional uses.

[Updated on: Fri, 16 December 2011 12:51]

Report message to a moderator

Previous Topic:Issue with Jetty 7 upgrade because Equinox SDK 3.7.1 includes old Jetty libs - version 6.1.23
Next Topic:publisher eclipse bundles missing
Goto Forum:
  


Current Time: Tue Jul 29 21:06:48 EDT 2014

Powered by FUDForum. Page generated in 0.02239 seconds