Thursday, February 21, 2008

Costin Leau discusses how to turn a JAR into an OSGi bundle

Earlier this week I came across this blog entry by Costin Leau which describes how to turn a standard, run-of-the-mill JAR into an OSGi bundle. Wow - it's pretty straightforward, and there aren't any significant magical incantations involved. It's nice to see that the process for bundling up an OSGi component is so straightforward - I was afraid that there were some significant hurdles involved.

Of course, the manifest entry is probably the easiest part. I'm willing to bet that if you took most JARs that exist in existing, internal enterprise applications and ran them through the Bnd tool that Costin mentioned, that youd have a massive list of required imports. It reminds me of something Peter Kriens said in this InfoQ interview:

John Wells from BEA [..] had a presentation and he said: "we thought we were working modularly -- we were disciplined, we were doing the right thing and we were so surprised when we moved to OSGi because we found out we never had been working modularly, we had all these dependencies, all these links to all kinds of subsystems and we never noticed it because it was all on the classpath, and as long as you didn't use it you didn't run into the problem"

No comments: