But what is OSGi?

I've been trying to write an introductory article about OSGi for a few days. But the problem is that it's such a a simple yet powerful technology that I didn't really know where to start, what angle was best. And then I found two excellent articles that really... "opened my eyes" and that I want to share with you:

  • The first one is a very "hands-on" one in the form of a tutorial about setting up Equinox (Eclipse's OSGi implementation) and everything around it to work with bundles. It's tightly coupled with Eclipse, but since that's what most people are using, why not. And it's very high quality.
  • The second one is even more interesting, it's written by Costin Leau, project lead for Spring Dynamic Modules at SpringSource, and it gives comprehensive information about the most fundamental concept in OSGi: bundles. Really a must-read.

Now I would love to have your opinion about the content of this zone. What do you think of that kind of article? What questions do you have related to OSGi?

Oh, and by the way, if anyone reading this plans to attend OSGi DevCon next month, it would be really great if we could cover this event in OSGi zone. Unfortunately I can't cover it myself because Santa Clara is quite far away from Belgium. But if you are interested in giving us your impressions and writing about the latest news announced there, feel free to get in touch.

4
Average: 4 (3 votes)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Johannes U. J. replied on Mon, 2008/02/18 - 12:14pm

The question I have isnt as much about OSGi as it is about modules. OSGi is apparently a super good solution to using modules, but what I would like to know is why I need modules. What do they bring to the table that I cant do without, or is quite harder without? Obviously applications like Eclipse benefit hugely from a nice module system, but are there less extreme cases that I can use modules for?

Sebastien Arbogast replied on Mon, 2008/02/18 - 1:57pm

It's a little bit like Flex. It's difficult to see what you can't do without a new technology until you realize that you've got so used to the limitations of older technologies that you just can't imagine how limited you are. Then you try it and you realize that it opens up so many possibilities.

There are a few use cases though, where OSGi is obviously a great step forward for us Java developers.

  • I'm working on a server application with two access interfaces, SOAP and REST, and each access interface is in a different web application. They are both using the same libraries, except for a few exceptions where various version collide in a very ugly way. The only viable solution I found was to deploy 2 web applications with a copy of each library in both WAR archives. Not very easy to distribute. Not very easy to maintain. And deployment in production environment over SFTP is really a pain. OSGi offers a solution for that.
  • Have you ever noticed as most popular CMS systems use PHP? I see a very simple reason for that: since PHP is interpreted, it's naturally great for extensibility and dynamic insertion of modules. I won't trigger a Java vs. PHP debate here, but let's just say that I'm far more confortable with Java. With OSGi we can have the same degree of flexibility and extensibility with Java enterprise applications. And suddenly my dream to have a flexible and extensible collaboration suite in Java becomes possible.
Other examples anyone?

Al replied on Mon, 2008/02/18 - 5:37pm in response to: sarbogast

If you are using Maven and pom file dependency declarations, I would recommend you using POMStrap (http://pomstrap.prefetch.com/), an application boostrap that allows you manage dependencies (such as modules) and confine your libraries in a classloader hierarchy.

Marcel Offermans replied on Mon, 2008/02/18 - 6:58pm

To be honest, OSGi has a lot more features when it comes to handling dependencies than something like POMStrap. If your needs are modest, such a tool might be enough, but OSGi has a lot more features, such as dynamically updating modules, having multiple different versions of modules available to different parts of your application and dependency management that is based on interfaces, not implementations, which gives you better substitutability.

And Sebastien, I will be attending EclipseCon and the OSGi DevCon, giving a workshop about building secure OSGi applications. I definitely would not mind covering the event here. 

Rick Ross replied on Mon, 2008/02/18 - 8:58pm in response to: marrs

Marcel, you are very kind to offer to help cover OSGi topics from EclipseCon here. Thank you!

Rick 

Marcel Offermans replied on Tue, 2008/02/19 - 9:33am

You're welcome, Rick, it's nice I can do something for the community!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.