Skip to content

Latest commit

 

History

History
18 lines (10 loc) · 593 Bytes

File metadata and controls

18 lines (10 loc) · 593 Bytes

Single responsibility principle (SRP)


Important This principle suggests that a class should have only one job or responsibility. This doesn't mean that each class should have only one method, but rather that all the methods in a class should relate to a single purpose. By following this principle, it becomes easier to maintain and modify the class as changes will only be required when there's a change to the responsibility of the class.


Examples

Example in C#

Example in C++ (soon)

Example in Java (soon)

Example in python (soon)