Looking for software experts?
Need an expert advice on software development? Need consulting work done in time and at high standards? Tremend has the right solution for you.

We can provide expertise in:
  •    » high traffic and complex content website infrastructures using Java, PHP or .NET. More here ...
  •    » mobile applications for iPhone, Android or J2ME. More here ...

For an enquiry, send an email to contact [at] tremend [dot] ro.

New uses of the OSGi plug-in model

August 15th, 2006 by Robert Enyedi in Java, General

I grew accustomed to the OSGi plugin model having developed some Eclipse plugins and RCP applications. I found it reasonably simple and useful because it allows Java code isolation and management at a higher level (groups of packages). I think that these plugins are the closest to what component based software development should be.

In the OSGi plugin model there is no global classpath. A plugin has its own classpath or can inherit partially or totally the classpaths of other plugins. With this the so called “JAR hell” with multiple JAR versions on the same classpath is actually avoided.

Others seem to also find this plugin model useful. Recently I’ve heard of several usages of the OSGi plugin model outside of the Eclipse platform:
- in the eRCP project which promises plugin based mobile software development – some elements of this can be achieved even on J2ME: http://www-128.ibm.com/developerworks/wireless/library/wi-osgi/
- componentization of IBM WebSphere 6.1 with OSGi (http://www.eclipsezone.com/eclipse/forums/m92036274.html) with hints on the componentization of the Apache Geronimo project
- the 5 series BMW uses the OSGi specifications as the base technology for its high-end infotainment platform (http://www.hometoys.com/htinews/aug04/interviews/osgi/osgi.htm)
- JSR 291: Dynamic Component Support for JavaTM SE will also use OSGi. This way, among others, the ever growing rt.jar could be easily split into more manageable entities.

This link is a good start for getting to know the OSGi plugin model and how it integrates into the Eclipse platform: http://www-128.ibm.com/developerworks/opensource/library/os-ecl-osgi/.

The Wikipedia article on OSGi is also accurate: http://en.wikipedia.org/wiki/OSGi

DZoneGoogle ReaderYahoo MessengerRedditEmailDelicious

Related posts

  • Intellij Idea versus Eclipse – part II
    >> 10 reasons why Eclipse is better Most of the following are not checked in Idea 6.0 which is anyways in beta. They refer to 4.x and 5.x Idea versions. 1. The visual editor - one feature that...
  • Where in the /dev is the card reader?
    I've plugged a card reader in a USB socket on my Linux box and it's not that trivial to know if it's on /dev/sda or /dev/sdb or elsewhere. That can be even dangerous - I know someone who just erased his...
  • Hibernate schema maintenance
    Hibernate provides a nice way to keep your DB schema in sync with the model. At least 2 choices are available: - have the hibernate.hbm2ddl.auto set to auto during development - use various utilities:...
  • Eclipse Java Autocompletion Not Working
    One day, after starting Eclipse 3.2, I noticed astonished that the autocomplete feature for Java classes did not work anymore. On pressing Ctrl+Space the popup list did appear, but it was always empty....
  • Intellij Idea versus Eclipse – part I
    >> 10 reasons why Idea is better In this part I'm focusing on advantages of Idea over Eclipse. I plan for a 2nd part to check out the other side - advantages when using Eclipse over Idea. This...
.

2 Responses

  1. Marius Hanganu Says:

    I still think the model is not perfect. Think of the situations where you need to make a library publicly available to several plugins. The only way to do it and not duplicate it for all plugins is to create a new plugin which includes the library and make all other plugins dependent on your newly created plugin.

    Since this has become something like a “standard” solution, why the Eclipse team doesn’t “standardize” it somehow, making this transparent to you (I can already think of several solutions).

  2. Robert Enyedi Says:

    From the packaging point of view the OSGi plugin model is an evolution of the old JAR file format. An OSGi plugin can be packaged completely into a JAR file. In fact an existing JAR file could be easily transformed into a OSGi library plugin by adding plugin related information into the META-INF/MANIFEST.MF file. Thus the third party library libraries could easily be shipped as OSGi JARs which are usable as normal JARs.

    This trend will start probably when JSR 291 will get into the JDK. Until than this operation has to be done manually, granted. But still, by doing this you avoid the problem of multiple JAR versions by elliminating the global CLASSPATH. And I also see this as a superior CLASSPATH management solution.

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.