Dependency Injection: What's wrong with good old-fashioned refactoring?

Posted by Chuck on Stack Overflow See other posts from Stack Overflow or by Chuck
Published on 2010-03-26T21:55:46Z Indexed on 2010/03/27 16:43 UTC
Read the original article Hit count: 130

DI creates an extra layer of abstraction so that if your implementation class ever changes you can simply plug in a different class with the same interface.

But why not simply refactor when you want to use a different implementation class? Other languages like Python and Ruby work fine this way. Why not Java?

© Stack Overflow or respective owner

Related posts about refactoring

Related posts about dependency-injection