Equinox
l an OSGi R4 specification implementation
l Involve: OSGi framework implement, OSGi standard service bundles implementation, OSGi server-side App(J2EE), Equinox deployment framework
Modularity
l Objective: changes in on part of a system should not lead to unexpected behavior in other parts
l We need to be able to share classes and resource between bundles(modules), two main ways: Require-Bundle & Import-Package
Require-Bundle
l Gain access to all packages exported by another bundle
l Tight coupling
Import-Package
l Import specific packages
l Loose coupling
Best Practices: Modularity
l Import-Package is recommended
l Require-Bundles used for complex scenarios
Collaboration
Inter bundle collaboration:
l Extension registry
l Service registry
l Declarative Services(build upon the service registry)
Extension Registry
l A per extension point list of contributed extensions
l Private context
l Tightly coupled model
l Declarative : plugin.xml
l Lazy loading
l Life cycle scope: resolved state of bundle
l No security to control
Service Registry
l Pblish/discover/bind model
l Public context
l Loosely coupled model
l API based , non declarative
l Eager loading
l Life cycle scope: started state of bundle
l Permissions to control
Declarative Services
l Build upon Service Registry
l Adds a declarative mechanism
l Simplified programming model: POJO with dependency injection(IoC)
l Lazy loading
l Lifecycle managed by central runtime
Best practices: collaboration
l Extension Registry: tightly coupled relationship
l Declarative Services: loosely coupled relationship(recommended)
l Service Registry: same as Declarative Services, unless have a complex need