![]() ![]() This is what the Dosa Maker Modules look like. 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. 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?" 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." Single Responsibility Example Healthy diet is very important both for the body and mind. ![]() Rahul: "As you already know, the US team is moving on to another project. Single Responsibility Principle SOLID Principles kudvenkat 2. Rahul: "Congratulation on your promotion Mohan!" Mohan: "Thanks, Rahul." In this article, you will be introduced to each principle individually to understand how SOLID can help make you a better developer. Mohan was sitting in his room, waiting for his next task to be assigned after promotion. This principle helps us to maintain, test and scale the codebase easily because changes in requirements do not affect multiple areas of the codebase. 1 Answer Sorted by: 1 As your class above has atleast two responsibilities i.e. In other words, a class should have only one reason to change and it should be focused on doing one thing well. 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. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |