Saturday, July 23, 2016

Refactoring for SOLID

I read the two articles below on refactoring and SOLID principles.


In the OOP section of the above article, the interesting takeaway is the encapsulation of logic in a "policy" class which is used along "doer" classes to be invoked and thus abstract away and remove cyclomatic complexity from methods.


This one lends credence to the notion of the "large set of small classes" to abide by the Single Responsibility Principle. The emphasis is on composition of behavior, and using seams or interfaces to swap out or extend (by using decorators) existing behaviors to add new features.

No comments:

Post a Comment