About this document
Understanding the Single Responsibility Principle by naturaleletric8231 is a document available to read on EtoBox.
The Single Responsibility Principle (SRP) states that a class should have one, and only one, reason to change. In the example of a bowling game, the responsibilities of tracking frames and calculating scores were separated into two classes to avoid breaking this principle. SRP violations can occur subtly, such as when a Rectangle class has responsibilities for both geometry calculations and graphical rendering. Interfaces should also separate distinct responsibilities, like a modem
- Author
- naturaleletric8231
- Language
- EN