views:

678

answers:

2

I'm a little confused on the approach to extensions/services in the Eclipse architecture. There are two options available to a developer:

  1. The use of Eclipse plugin extensions - http://www.eclipse.org/articles/Article-Plug-in-architecture/plugin_architecture.html
  2. The use of declarative services - http://www.eclipse.org/equinox/bundles/

When you would use one over the other and what are the advantages and the disadvantages of each approach? Also going forward which is the preferred approach?

+1  A: 

There's a pretty good comparison (from 2007, I think) on EclipseZone: A Comparison of Eclipse Extensions and OSGi Services.

I would follow the conventions of your target platform. So, if you're writing a plugin for Eclipse 3.4, say, create an Eclipse 3.4 plugin (which will use a MANIFEST.MF for dependencies and a plugin.xml for extensions/extension points - the article you link to is for Eclipse 2.x). You can examine the contents of the plugins directory to confirm this.

McDowell
That's an interesting article on both approaches, some good advantages and disadvantages on each.
Jon
+1  A: 
VonC
Thanks. I understand how to create services uses DS, but I was looking for the advantages/disadvantages of each and any hints the Eclipse vision and preferred approach (if any) moving forward.
Jon
@Jon: I understand. I just wanted to point out one disadvantage you will find in both approaches (explicit dependency) unless you are using the latest DS specification.
VonC