Segregation of responsibilities with the Single Responsibility Principle
T his article, the first of the 5-part article on S.O.L.I.D design principles, is about the “S,” Single responsibility principle made famous by Robert C. Martin (Uncle Bob)in his paper, https://web.archive.org/web/20150924054349/http://www.objectmentor.com/resources/articles/Principles_and_Patterns.pd f. S — Single-Responsibility Principle O — O pen- C losed P rinciple L — L iskov S ubstitution P rinciple I — I nterface S egregation P rinciple D — D ependency I nversion P rinciple 4 C’s — Concern, Coupling, Cohesion & Change A concern is defined as a set of information that has the potential to affect, alter, change the state of any entity. In computer science, concerns are everywhere. Logical grouping of operations and data is another definition of concern. Examples include a series of actions to fetch data from a server. A read-write dat...