Tag Archives: Spring DM

The myth of OSGi-fying 3rd party libraries

There is a nice SpringSource blog about their plans for building OSGi applications. Actually, it’s more an advertisment for their tool called bundlor which basically has the same purpose as bnd but is implemented in a different way.

There is one point in the blog the I don’t like at all. It’s yet again I hear the myth about automatically generating OSGi bundles from 3rd party libraries and how successful it is used in the SpringSource bundle repository. Folks, it might work for one 3rd party library but it will never work  in an automated way for all 3rd party libraries. There are just too many issues around OSGi-fying 3rd party libs which need to be addressed carefully. If the library deals with class loading you might be out of luck no matter how great your generated manifests look like. You need to modify your source code and/or patch the 3rd party library to make it work correctly. Even better, sometimes there are multiple ways to convert a 3rd party library into an OSGi bundle. A stubborn one-to-one conversion process cannot incorporate that. It may depend on your requirements and preferences.

The process is not finished with generating manifests. Be aware that this can cause broken bundles. Those issues are fixable. But this example shows that every library requires careful attention.

OSGi RFC 124

Who else read RFC 124? It has a really funny title: “A Component Model for OSGi”. Yeah, that really speaks for itself. Just repeat it a few times and let it settle for a while. So, RFC 124 wants to create a component model for a component model. Funny, eh?

But is that really what people need? Maybe I just don’t get it but I thought the real problem was that programming OSGi is too verbose.

Well, I’m certainly not arguing against that. Programming OSGi is verbose. When creating services you need to write additional code to maintain their registrations. When consuming services you need to write additional code to track available services. Last but not least you need some plumbing around. Continue reading OSGi RFC 124