Member-only story
Throughout the internet there are a plethora of articles explaining what SOLID is, what SOLID isn’t, as well as, code examples of how each principle is applied.
SOLID is an acronym that represents the 5 object-oriented design principles outlayed by Robert C Martin.
These 5 principles are used as guidelines to establish good practice in creating maintainable software as the project grows. Incorporating these principles within your code or development team can greatly enhance the testability of your code, making it easier to maintain and debug, avoid code smells and help contribute to adopting an Agile development style.
The first principle is Single-responsibility Principle.
Single-responsibility Principle
The single-responsibility princriple states that “a class should have one, and only one, reason to change”. One of the main reasons as to why it is advised to implement this principle is that makes your software easier to implement and prevents unintended consequences of future changes. So lets say this, you have created a class in your local development code for a certain feature in your system and then 2 weeks later the requirements spec changes for the feature which means you have to add another piece of code to your class…