Single Responsibility Principle

The single responsibility principle states that each class in the program should have a single purpose.

If a class has more than one purpose, it is likely to be used in more than one place doing different work. This shows that changes you make in future development requests may affect multiple functions-pages, which will result in system breakage and longer review processes for future updates.

In summary; For a class you wrote, someone asked, “What does it do?” If there is an “and” in your answer, there is a problem here.

You may also like...