This is the final installment of a two-part series on what you can do to ensure your project's code base is following the SOLID design principles as closely as possible. In Part 1, we looked at the Single Responsibility Principle and the Open-Closed Principle. Here in Part 2, we will look at the final three principles: the Liskov Substitution Principle, the Interface Segregation Principle, and the Dependency Inversion Principle.
When starting a new project, nobody intends to write poor code; yet without vigilant watch and a practice of refactoring, every code base eventually descends into chaos. Often the damage is done before anyone realizes it. One day you are looking through the code to make a change and you think to yourself, “This code is terrible! Who wrote this anyway?” You pull up the history on the file and realize… oh, it was me! Not a good feeling.
Topics: Design Pattern