- Summary
- DI can be considered as special case (subset) of IOC that just guide how to satisfy object dependencies i.e. initialize Object properties at run time.
- It is more of a implementation (Coding) concept that design one.
- All the IOC frameworks support DI mechanism.
- Applicability
- There are mainly two situations when Dependency
Injection is very powerful. Either by using factory
or by using containers however
containers are more preferred way.
- DI Types
- Constructors
- Methods
- Properties
- Implementation Techniques
- Dependencies can be injected by any of following mechanism
- Exposing Dependency Objects Property
- Exposing Setter Function
- Using Constructors
- Configuration Files
- Dependency Injection Frameworks
- Spring (Java)
- Spring.Net (MS dot net).
- Related Pattern
- Strategy can use DI to load strategy at run time
- Related Disscussion
- Dependency Injection And Factory Pattern
- IOC Vs DI
- IOC guides how to achieve loose coupling at brod level and and uses some mechanism of DI to s initialize Object properties at run time
- http://www.martinfowler.com/articles/injection.html#InversionOfControl
- http://neelzone.wordpress.com/2007/04/04/injection-and-inversion/
- http://javavillage.in/view_topic.php?id=45
|
|