Single Responsibility Principle
SOLID is a mnemonic acronym named by Robert C. Martin used in Software Programming, It represents 5 principles of Object-Oriented Programming. All of them are broadly used and worth knowing. But in this post, I will focus on the first one: the Single Responsibility Principle (SRP). One class should only serve one purpose, this does not imply that each class should have only one method but they should all relate directly to the responsibility of the class. All the functions, methods, and properties should all work towards the same goal.
Nov-15-2021, 08:18:25 GMT
- Technology: