Inversion of Control Containers and the Dependency Injection ...
Popularity Report
![]() |
|||
![]() |
|||
![]() |
|||
![]() |
|||
![]() |
|||
![]() |
URL Tag Cloud
Bookmark History
Saved by 34 people (1 private), first by anonymouse user on 2006-07-05
- Magoth on 2008-10-18 - Tags patterns , inversion-of-control , dependency-injection
- Hkittaka on 2008-07-26 - Tags article , di-container , servicelocator
- Eisenham on 2008-06-24 - Tags ioc , design , pattern , architecture , java , spring , dip
- Bubba9er on 2008-06-22 - Tags Computing , S_WDevelopment , DesignPatterns , patterns
- Akshyin on 2008-06-06 - Tags pattern
Public Sticky notes
Highlighted by gman_sm
Highlighted by gman_sm
Highlighted by microshort
Highlighted by microshort
Highlighted by navneetk
Highlighted by navneetk
Highlighted by navneetk
Highlighted by navneetk
Highlighted by navneetk
Highlighted by navneetk
In this kind of scenario I don't see the injector's inversion as providing anything compelling.
The difference comes if the lister is a component that I'm providing to an application that other people are writing. In this case I don't know much about the APIs of the service locators that my customers are going to use. Each customer might have their own incompatible service locators
Highlighted by navneetk
Highlighted by navneetk
Highlighted by navneetk
Highlighted by navneetk
Highlighted by navneetk
Highlighted by navneetk
Highlighted by navneetk
Highlighted by navneetk
Highlighted by navneetk
Highlighted by navneetk
Highlighted by navneetk
Highlighted by navneetk
Highlighted by navneetk
Highlighted by zubinkavarana
If you have multiple ways to construct a valid object, it can be hard to show this through constructors, since constructors can only vary on the number and type of parameters. This is when Factory Methods come into play, these can use a combination of private constructors and setters to implement their work. The problem with classic Factory Methods for components assembly is that they are usually seen as static methods, and you can't have those on interfaces. You can make a factory class, but then that just becomes another service instance. A factory service is often a good tactic, but you still have to instantiate the factory using one of the techniques here.
Constructors also suffer if you have simple parameters such as strings. With setter injection you can give each setter a name to indicate what the string is supposed to do. With constructors you are just relying on the position, which is harder to follow.
Highlighted by zubinkavarana
Highlighted by danielgelinas
Highlighted by sinewmy


Public Comment