Marco Ehrentreich wrote:
- NetBeans allows (partly) to insert or remove module bundles at runtime.
- It automatically manages dependencies and takes care to avoid circular dependencies.
- The current version seems to allow modules to get loaded only on demand.
- NetBeans allows meta data for modules like a version number, description...
- A module can be almost anything, including resources like images etc.
- NetBeans allows to distinguish between service APIs and service implementations (which can be in different modules).
Sounds quite similar to OSGi. Let me create my own list of OSGi capabilities:
- OSGi allows bundles (what they call modules in OSGi...just JAR files with special info in the manifest) to be installed, uninstalled, stopped, started, or replaced at runtime while the app is running.
- Dependencies are automatically handled at the package level. A bundle may declare that it exports one or more packages (all others will be private to that bundle by default) and another bundle may declare that it imports those packages. If there's more than one version of a given package available, the bundle can declare which version it uses.
- OSGi leverages the META-INF/MANIFEST.MF file found in every JAR file for its metadata. That metadata may include, among other things, version numbers, descriptions, packages imported/exported, etc.
- Modules in OSGi are JAR files. An image (for instance) can't be a module. But a bundle may contain an image that is made available to other bundles.
- Just like NetBeans, service interfaces and implementations are distinct concepts and can be in different bundles.
So, without knowing any more about NetBeans, I can say that OSGi and NetBeans modules share a lot of commonality. Where do they differ? I don't know...yet. Which is better? I'm going to avoid answering that question.