Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 751 Bytes

File metadata and controls

14 lines (10 loc) · 751 Bytes

Single Responsibility Principle

Overview

Single-responsibility principle (SRP) is a principle under SOLID Design Principles which states that every module, class or function in a application should have responsibility over a single part of that program's functionality, and it should encapsulate that part.

It makes program easier to implement and prevents unexpected side effects in future changes. Its main intention is that every class, function or method should be responsible to do only one work.

Classes, components and microservices that have only one responsibility are much easier to explain, understand and implement than the ones that provide a solution for everything. This reduces the number of bugs, improves development speed.