Refactoring your legacy code using SOLID principles
Muhammad Sumon Molla Selim�@SumonMSelim
Working with legacy code
Why SOLID?
Single Responsibility Principle
Gather together the things that change for the same reasons. Separate those things that change for different reasons.
Single Responsibility Principle
Open/Closed Principle
You should be able to extend the behavior of a system without having to modify that system.
Open/Closed Principle
Liskov Substitution Principle
Let φ(x) be a property provable about objects x of type T. Then φ(y) should also be true for objects y of type S where S is a subtype of T.
Liskov Substitution Principle
Interface Segregation Principle
No client should be forced to depend on methods it does not use.
Interface Segregation Principle
Dependency Inversion Principle
High-level modules should not depend on low-level modules. Both should depend on abstractions.
Dependency Inversion Principle
REMEMBER
Resources
Muhammad Sumon Molla Selim