On 08/02/2012 23:45, Alex Harui wrote:
My simple mind just can't understand why we need a sophisticated multi-step
plan or full dependency injection.  Why can't a simpler substitution pattern
do the job?

The complexity always comes with the detail. I assume one could summarize it with:

Move the static constructs to a service locator to implement unit tests and replace it step by step to get a injectable source code.

I broke the refactoring up in many steps to illustrate that this way will be constantly tested from step 2.

Michaels approach as well as your approach will most likely be more complex in reality than summarized. For example: Modifying the compiler, creating an AOP mechanism and then changing all code to follow that pattern is a huge project. where each part has to be tested.

I am curious about the "simpler substitution": How would you do that in detail?

yours
Martin.


Reply via email to