A method to build self-organized dependency injection system for IOC/COP system
Publication Date: 2010-Nov-18
The IP.com Prior Art Database
Development based on component-oriented framework is very effective, but the developpment based on framework such as OSGI/Spring, will introduce dependencies to the developped components from the framework, this behavior low the effective of unit testing and re-usebility. This aricle will introduce a self-organized dependency injection mechanism, with this mechanism the components will never dependent on any framework, then the development and testing will be more effective.
Page 01 of 5
A method to build self -
In IOC/COP based architecture, dependency injection is one of the most important part , it solve how the Plug-in/Component is organized, how they are dependent each other .
Dependency injection pattern includes : Set method injection/Construction injection/Service locator/Factory
In a running IOC/COP system, one component need to be replaced with another implementation for another mechanism , then the components dependent on it need to be updated , and the dependency of new added component need to be updated .
But there are some problems with the typical dependency injections in this scenario :
#1 IOC framework with set method dependency injection support well with static dependency injection , but hard to do with the dynamic injection during runtime .
it can inject dependency for the new added component , but it fails to update the components dependent on new added one .
#2 IOC framework with the construction injection is less powerful than set method injection , but same problem with dynamic injection .
#3 COP framework with the service locator manner can solve the dynamic injection well , but it dependent service locator , sometimes it dependent on the container , then the component can not be separately test and invocation .
#4 Spring framework is popular with set method and construction injection .
#5 OSGI is popular with the service locator manner .
Introduction & description
An self-organized dependency injection mechanism can inject the dependency between plug -in/componentdynamically according to the dependency network, the network build/transform are dynamically and self -organized, the register/unregister/dependency injection for component in the network are self -organized.
Build up the dependency network according to the dependency declaration , utilize the publish/subscribe mechanism to build the dependency relationship between one component with other components .
The approach will bring a self -organized com...