Friday, 14 March 2008

Eclipse vs OSGI and Solstice vs RCP

This post is in response to the comment on my Solstice announcement linked above.

What is the difference between OSGi and Eclipse?

OSGi is the foundation of the Eclipse platform. Eclipse is built on top of OSGi.

OSGi has the concept of "bundles" which are modular Java components. Eclipse takes that concept and extends it to what most developers know are "plugins". A plugin though is just a bundle with a plugin.xml file. The plugin.xml file tells Eclipse how to deal with that particular bundle and defines extensions and extension points, more concepts that build on OSGi, though OSGi is predominantly service oriented.

The high level stack for Eclipse is:
  1. Java
  2. OSGi
  3. Equinox (an implementation of OSGi)
  4. Eclipse (SWT, JFace, etc)
I should point out that extensions and extension points are not only extremely useful for the UI/RCP side of things, but are a useful tool in general. My perference however is to try and remain as service oriented as possible using only OSGi services and interfaces that are in the specification and compendium where I can. That said, the Eclipse "plugin registry" can be used on any OSGi platform so developers shouldn't worry about tying themselves in to Eclipse if they want to use plugins and or instead of bundles.

Solstice vs RCP

Eclipse is a great platform for building modular rich applications for the desktop and there is certainly progress towards being able to deliver these applications over the web (I'm talking specifically of RAP). My understanding though is that RAP isn't mature yet and personally I'm not keen on AJAX or in fact having any dependancy on browser technologies. I prefer cross-platform runtimes such as Java or Flash Player.

For me the advantage of using Flex (especially when used with Solstice) over Eclipse RCP are:
  • Reduced footprint for installation of the software. Flash Player is small and the binaries for your application will be much smaller compared to Eclipse.

  • Easier to deliver the software to the users. Flex applications are delievered via the web, whereas Eclipse requires some installation.

  • Consistent platform for development.
    • Flash Player is identical across all supported platforms and according to Adobe at least some version of Flash Player is now present on 98% of all computers with FlashPlayer 9 coming in around 90%-95%.
    • SWT doesn't support all platforms in the same way.
    • Eclipse UIs look native.

  • Flex is easier to learn than RCP. I'm a software engineer / developer with more than 10 years experience (8 of that using Java) and found the learning curve for Eclipse to be very steep, but I persisted because Eclipse is "cool". Though I can create simple plugins quite quickly these days when I try and do something with Eclipse the complexity of the platform leaves me feeling unproductive. When I got my job with Arum I learnt Flex in a matter of weeks.

  • Flex allows developers to be creative with the UI. This is a duel edged sword really. Eclipse has a constistent UI (subject to native look and feel), but I have seen some stuff done with Flex that I couldn't dream of doing in Eclipse. Either that or you have to install or develop entire new frameworks to achieve something relatively (e.g. GEF for graphical editing, but it can't even rotate a text label!). The other side of that sword is that the UIs I personally produce still look very developer oriented (like an Eclipse app) and you really need that creative flare to do the exciting things I seen done with Flex. My focus is on the Java/Server side of things anyway, so I'm not too worried about that aspect of things. My colleagues are much better at Flex UIs than I am.

Flex is great but I felt as though I was missing out on the modular power that OSGi and the Eclipse RCP gives developers, which was my starting point when putting together Solstice. Using the Equinox and BlazeDS I managed to put a Flex UI in front of an OSGi container in an afternoon and I just carried on from there.

Flex has the concept of modules, but mainly for the puropse of reducing perceived load times. It seemed obvious to me that the dynamic ability of the Flash platform could end up creating an alternative to RCP.

Solstice is a good step towards that. Developers can still use the OSGi and all those good things that go with it (component oriented, service oriented) without feeling as though the only option for a UI is the Eclipse RCP or HTML website exposed through the HttpService.


Emmanuel said...

Great! That confirm what I thought. I'm happy to see that I'm not alone thinking of Ajax as a dead end.

So I tried Solstice and I sucessfully deployed an empty plugin with just a simple Activator helloworded.

If you don't mind, I'll use some help getting really started by making a simple button appear, calling a service who extract some data and show it.

Mike Milinkovich said...


The work that you're doing with Solstice is very much on-topic for the E4 (aka Eclipse 4.0) work that is going to be discussed next week at EclipseCon.

The team is very interested in involving new people and new ideas. Do you have any interest in chatting about collaboration?

I'm the Executive Director of the Eclipse Foundation and would be happy to make some intros if you're interested. You can reach me at mike at eclipse dot org.

maz said...

Hi Chris,

You are definitely right, from a technology stack standpoint there is a huge place for what could be an RCP online. Joining Java + OSGi as a backend with Flex + (RCP and its OSGi platform - that one living on the client)...

And the very very powerful approach here could be the extension of Solstice to AIR : then you would have a very interesting hybrid framework (deployed online + extended to the desktop) that absolutely no other technology enables.


Computer Books said...

This is great! really looking forward for a next version. I hope the documentation gets better.

Computer Books said...
This comment has been removed by the author.
Computer Books said...

hi i am trying to run this in JBoss 4.2 but every time i install and start the auth module i get this error
Error #2035: URL Not Found. URL: http://localhost:8080/Solstice/osgi/
am i doing anything wrong here. But this product seems to be great, can we get a better documentation to understand it more better to customize it. Thanks for the good work

Chris Brind said...

try: http://localhost:8080/Solstice/osgi/Admin.swf

and when you have an application installed:



Computer Books said...

hi Chris thanks for the reply, http://localhost:8080/osgi/Solstice/Admin.swf
give status 404 error for me.
I can get the admin to run in URL
only thing is that after i install auth bundle i get the error. I am not sure if i am asking too much but i don't see implementation of BundleManager interface in the source code for authentication bundle's Activator class. I really want to run this and work on this app :)