I read the book Working effectivly with Legacy code
.
I understand the technics to break dependencies in Legacy code
But I want to understand how to avoid these dependencies for the first time:
1- Regarding static methods:
I understand Introduce Instance Delegator
But does it mean we should avoid static methods at all?
(when it not just a Macro for some piece of code.
Meaning it has some real logic and it's instance independant?)
2- Global variable
I understand Introduce Static Setter
,
but again - should we avoid Singelton at all?