The OR mismatch. Microsoft has it on its radar screen Improving JavaServer Faces by dumping JSP
Jun 10

Dependency Injection as an Assembly line pattern

Tech Add comments

Scott Ferguson of Caucho (Resin) likes to think of IoC as an assembly pattern, and this makes the choice of constructor-based versus setter-based versus getter-based small fry… in the implementation… as apposed to the big picture.

Working through some dependency injection documentation, I’m finding it better to think of the IoC/DI pattern as an “Assembly Line” pattern.
As an Assembly Line pattern, the setter vs constructor issue looks like choosing between metric and British measurement or Phillips vs flat screws. The choice does matter, but it’s a minor decision compared to choosing IoC/DI in the first place.

The point of the Assembly Line pattern is that the Parts and Chassis are decoupled from the choice of Assembler. The parts need to conform to some rules: like Phillips screws, but otherwise it’s straightforward to switch Assemblers from a container to a test suite.

Resin IoC Tutorial: Dependency Injection for Resources

Leave a Reply

Spam is a pain, I am sorry to have to do this to you, but can you answer the question below?

Q: What are the first four letters in the word British?