

Rahul: "Stop talking nonsense! If we don’t duplicate, then who will pay for your salary? :)" Mohan: "In that case, why do we need a V2? Can’t we use the same code here?" It was first cited in this form by Robert C. So now it’s our responsibility to sunset their current project The Dosa Maker and come up with an innovative design for the brand new The Dosa Maker V2.0." The Single Responsibility Principle (SRP) states that a class should have only one reason to change. Rahul: "As you already know, the US team is moving on to another project. The single responsibility principle is a design principle which states that every class or module should have one responsibility and one reason to change. Rahul: "Congratulation on your promotion Mohan!" Mohan: "Thanks, Rahul."

Mohan was sitting in his room, waiting for his next task to be assigned after promotion.

As we might expect, this principle states that a class should only have one responsibility. This principle helps us to maintain, test and scale the codebase easily because changes in requirements do not affect multiple areas of the codebase. Lets kick things off with the single responsibility principle. In other words, a class should have only one reason to change and it should be focused on doing one thing well.
#Single responsibility principle software#
The Single Responsibility Principle (SRP) is one of the SOLID principles in software engineering that states that every module or class should have only one responsibility and that responsibility should be entirely encapsulated within the class.
