Posts

Posts mit dem Label "Dependeny Injection" werden angezeigt.

Dependency Injection in OSGi

The OSGi framework and its compendium services provide a whole lot of fun to build applications. Defining bundles is a cool stuff to cut the big job into pieces and enjoy the coolness of separation of concerns just like the old Romans said: Divide et Impera ! One interesting compendium specification is the Declarative Services Specification. This specification tries and IMHO succeeds very well to bring some of the cool stuff of Spring, namely Dependency Injection, into the OSGi world. Just like the application descriptors in Spring you have component descriptors in Declarative Services. Using a component descriptor, you define the following properties of a component: The name of the component and whether it is activated immediately or not Whether the component is a service and the service interfaces to register the component with Which other services are used by the component. These services may be injected (bound in OSGi speak) or may be looked up. There is also the notion of mandator...