While beeing a platform technology in its core, the OSGi technology seems to use and promote certain patterns as well. The Whiteboard and Extender pattern are well-known examples for this. So why shouldn't we put these patterns in a more jokey and useful way?
Zen of OSGi
- Graphs are better than trees.
- Prefer services over objects.
- Import is better than required.
- Although required is better than classpath.
- Only export stuff you want to provide support for.
- Once you support something, support it forever.
- Import your exports.
- Minimise your dependencies.
- But do not omit imports you really use.
- Do not rely on start ordering.
- Listen to your customer, do not make them listen to you.
- Communicate your version policy.
- Be as permissive as possible but no more.
- Use the obvious OSGi way.
- Although that way may not be obvious at first unless you're Dutch.
- Expect the unexpected (especially when you are dealing with services).
Any important rules missing?
4 comments:
Roman, myself being Dutch, but not from the OSGI incrowd, can you explain the Dutch reference in the final but last zen rule?
Tim Peters included the same rule in the Zen of Python since Guido van Rossum, the author of Python, is Dutch.
The idea of OSGi was started by Peter Kriens (Dutch as well), now the OSGi evangelist and actively involved in the standardization process.
I included this rule to pay tribute to the Zen of Python (for the idea) and to Peter for his great work and ambition.
Great post. A good simplification of the best practices of OSGi.
I'm not dutch ... so I guess OSGi will flow into me more easily right? ;)
Post a Comment