Single Responsibility Principle

What Does Single Responsibility Principle Mean?

The single responsibility principle (SRP) is part of the “SOLID” acronym for programming principles developed by Robert C. Martin. It relates to each object in a codebase having a single specific function.


Techopedia Explains Single Responsibility Principle

SOLID principles include the single responsibility principle, as well as four other principles that rely on the SOLID acronym: open-closed, Liskov substitution, interface segregation and dependency inversion.

As part of this set, which is meant to simplify code development and extension and help with updates and changes, the single responsibility principle indicates a single function per class and helps with making code modular to prevent interdependencies. Classes and elements that have only one responsibility are easier to explain and easier to understand within a codebase environment. That makes the single function responsibility as part of the SOLID acronym a key way to optimize object-oriented programming.


Related Terms

Latest Software Development Terms

Related Reading

Margaret Rouse

Margaret Rouse is an award-winning technical writer and teacher known for her ability to explain complex technical subjects to a non-technical, business audience. Over the past twenty years her explanations have appeared on TechTarget websites and she's been cited as an authority in articles by the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine and Discovery Magazine.Margaret's idea of a fun day is helping IT and business professionals learn to speak each other’s highly specialized languages. If you have a suggestion for a new definition or how to improve a technical explanation, please email Margaret or contact her…