Friday, April 24, 2009

JAX 2009: Lessons Learned from 5 Years of Building Enterprise OSGi Applications

Yesterday I gave a talk at JAX 2009 about my experiences from using OSGi for enterprise application development over the past 5 years. I tried to sum up my experiences and most of all the mistakes I made during the past years using OSGi. If you are interested, take a look at the slides:
Enjoy - and try to not make the same mistakes than I... ;-)

3 comments:

Gary said...

I know this is an older post but your page on extension points made me curious about something.. What do you think the advantage is to using the Eclipse Plugins (Extension Points) vs using Plain OSGi and the Extender Pattern? Less boiler plate code? Better tool support?

Thanks!
Gary

Martin Lippert said...

The extension registry of Eclipse is implemented using the extender pattern. I think it highly depends on what you are going to build whether you could benefit from the extension registry or not. I use the extension registry (and don' implement my own extender) when I would like to use the extension point tooling, when I would like to define a schema for extensions that help people to build extensions, when my extensions fit into the general XML structure and when I might have many extensions. The extension registry does a good job of caching the parsed information for even thousands of extension definitions. This is a plus if you need the extension definitions before those bundles are activated (though are in resolved state) and you would not like to parse all those informations again and again at every startup.

So take a long story short: If I would end up building a lot of code to do stuff the extension registry already does for me, I use the extension registry.

HTH,
Martin

Gary said...

That makes sense but I found myself writing more code for the extension point. My "extension" involved a bunch to XML. So with EP I had to deal with the way Eclipse Parses the XML and returns the data in some sort of DOM like structure.. When I just used the Extender Pattern and a bundle listener I retrieved a URL to the XML from the Manifest header and then used an XML Parser to parse/bind it to my business objects (which the XJC utility generated for me).. So I thought I had less code.. Hmmm I should probably take another look at that..

Thanks for the feedback!
Gary