Podcast
Questions and Answers
What does the Single Responsibility Principle (S.R.P) state?
What does the Single Responsibility Principle (S.R.P) state?
- A class should only have one responsibility and one reason to change (correct)
- A class should have multiple responsibilities to enhance flexibility
- A class should have one responsibility but can change for various reasons
- A class should have no specific responsibility to allow for dynamic changes
What is the Open/Closed Principle (O.C.P)?
What is the Open/Closed Principle (O.C.P)?
- Software entities should be open for modification but closed for extension
- Software entities should be both open for extension and modification
- Software entities should be open for extension but closed for modification (correct)
- Software entities should neither be open for extension nor closed for modification
What is the Liskov Substitution Principle (L.S.P) about?
What is the Liskov Substitution Principle (L.S.P) about?
- Superclasses should not be able to replace subclasses to maintain program correctness
- Subclasses should not be able to replace superclasses to maintain program correctness
- Objects of a superclass should be able to replace objects of a subclass without affecting program correctness
- Objects of a subclass should be able to replace objects of a superclass without affecting program correctness (correct)
Which principle states that interfaces should be segregated based on client requirements?
Which principle states that interfaces should be segregated based on client requirements?
What does the Dependency Inversion Principle (D.I.P) emphasize?
What does the Dependency Inversion Principle (D.I.P) emphasize?