Member-only story
What is the Single Responsibility Principle(SRP) and why it is so important in system design?

Single Responsibility Principle(SRP) is one of the design principles that every engineer/entrepreneur (experienced or aspiring) should keep in mind from day one of their careers.
So what it preaches at high level→ A module should have only one reason to change.
We can attribute SRP to any field of work historically, as demonstrated below.
- Consider a restaurant, the billing module should be segregated from the cooking module which in turn should be segregated from the cleaning/serving module. If it is designed in this way then the restaurant will succeed in catering to customer demands and spikes in business. Responsibility of the person at billing should be to bill the customer and serving/cleaning should be to concentrate on that and Chef should concentrate on cooking. Suppose if billing desk experience a problem (say payment gateway connectivity issue) it should not disturb Chef job
- Consider any mid or large-sized company, it will contain different modules like finance, HR, sales, engineering e.t.c. Each module should be independent and should contain only one reason to change. Finance associates should be accounted for financial processes and HR associates for HR processes and similarly others. At a higher…