When I'm doing my job, I'm getting things done.

When OSGi (or modularity in general) is doing it's job, it is preventing things from getting done. That's the job of OSGi, to prevent things from working except within very narrow contractual relationships.

Which is why OSGi deserves a slow and painful death. OK OK OK, that's only the way I feel when I get in these week long moods that stem from my inability to get all the metadata right, and I can't get my "modules" to run perfectly.

No it doesn't take me a week to fix it. I ignore it for a week hoping it will fix itself. Rarely does. Or waiting for a response on some forum.

Author's Note:
This article received blistering comments and negative votes on dzone, where it was rated by many as an insulting waste of time. Too many to dismiss as invalid. Please continue at your own risk.
For a much more coherent expose on this same issue see this MuleSource blog.

The Math of OSGi:

Contrast the following to the simple formula of putting all your libraries/jars in your classpath:

If you were to do a math formula for OSGi, it works if and only if

  • a=true
  • b= true
  • c= true
  • d=true
  • e=true
  • etc, where a through ~ validates the exact state of various metadata file entries, locations, spring osgi configuration files, launcher files, config.ini, bundle configurations, start levels, activators, p2, maven, osgi.bnd etc etc.

None of these is very hard when it comes down to it. Just that there's a lot of moving parts, and it isn't very tolerant of people like me who want to do weird stuff like use Eclipse RCP and SpringFramework and OSGi Blueprints and latest SL4J and god knows what other crap, all at the same time without sufficient understanding of every technical nuance.

So I waste a bunch of time finding stuff that should work but doesn't in this particular configuration, or at least with my level of understanding.

Sometimes the tooling tries to be nice and fix your metadata for you. But then you don't understand it, so when you do something it doesn't expect...oh well.

From my perspective, the various the tools don't work that well together either, when you start using tooling that isn't tested to work together. Like Eclipse RCP and the incubator version of Gemini, and related STS and Eclipse Plugin IDEs.

And don't even think about pinging OSGi tooling forums. Developers have been running away from OSGi faster than Roadrunner being chased by the Coyote, and for good reason. It's not dead yet, but it's trying it's hardest. Support can be pretty spotty - in the open source world, anyway.

Two Years From Now

Two years from now, I'll be eating my words, laughing at all of my melodrama from 2010 and cracking jokes at myself just like Glenn Beck.

My modules will all be working perfectly. And I will be so much more experienced in this area than any developer should ever want to be.

But right now, I don't think it's that darn funny.