Seekershive Minds
Seeker’s Hive
Published in
Mar 1, 2022

Single responsibility principle

It can be closely associated with people management.

It is a common practice to assign a person with only one role at work.

Similarly in programming, one class should have only one responsibility.

If a person is assigned into multiple roles, then there will be lack of clarity and performance. The same issue applies to code as well.

In life we consider God as the person with super power of doing everything we people pray for.

In programming, object created using a class with multiple responsibilities are called God objects. It is a bad idea to have God objects in our code.

Separation of concerns is an important reason behind single responsibility principle.

Separate the responsibilities, so it is easy to manage, make changes, replace the code.

Thanks for reading through the article. Follow for more.