OSGi - Configuration and Settings package
From MediaWiki
This article opens a discussion about how JQuantLib should be implemented in an OSGi container. I've choose something relatively simple and already previously implemented by others, so we can concentrate more on best practices and some philosophical matters instead of how to implement it. Well, the discussion is open. I'm throwing some ideas below for your evaluation:
Aspects to consider
I can think of some generic aspects to consider, like ...
- Which OSGi container?
- OSGi concepts and best practices
- Maven and template bundles
- Closeness to QuantLib API
- Convenience of SOA
... but this specific example of Configuration and Settings deserves some other items:
- Adopt third-party packages?
- Borrow third-party code?
Existing OSGi interfaces
See how abstract class Preferences from JDK6 looks similar to interface Preferences from OSGi R4:
- JDK6 :: http://java.sun.com/javase/6/docs/api/java/util/prefs/Preferences.html
- OSGi R4.1 :: http://www.osgi.org/javadoc/r4v41/org/osgi/service/prefs/Preferences.html
In JQuantLib we have the concept of System preferences and user preferences. This OSGi interface looks promising:
Existing code
We could borrow some ideas from ...
- Apache Felix :: http://svn.apache.org/repos/asf/felix/trunk/prefs/src/main/java/org/apache/felix/prefs/
- Eclipse :: http://help.eclipse.org/ganymede/nftopic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/core/runtime/preferences/IEclipsePreferences.html
Our homework
Anyway, I think it's time to rethink our classes
- org.jquantlib.Configuration
- org.jquantlib.Settings
How to contribute to this discussion
Please click on tab discussion, on the top of this page and let's discuss how it should be implemented.
Your thoughts are welcome :)
Thanks
RichardGomes 22:56, 15 October 2008 (UTC)

