Which software design principle emphasizes “separation of concerns”?
a) Single Responsibility Principle
b) Interface Segregation Principle
c) Liskov Substitution Principle
d) Dependency Inversion Principle
Answer:
a) Single Responsibility Principle
Explanation:
The Single Responsibility Principle (SRP) emphasizes “separation of concerns” by stating that each software module or class should have only one reason to change. This means that each class or module should focus on a single functionality.
By adhering to SRP, developers can create software that is easier to maintain, test, and extend. Changes to one part of the system will not impact other parts, reducing the risk of introducing bugs when modifications are made.
The SRP is one of the five SOLID principles of object-oriented design, which guide developers in writing clean, maintainable, and scalable code.