Bird
0
0

What is the main benefit of applying the Open/Closed Principle (OCP) in software design?

medium📝 Conceptual Q5 of 15
Software Engineering - Fundamentals
What is the main benefit of applying the Open/Closed Principle (OCP) in software design?
ASoftware entities should be open for extension but closed for modification
BSoftware entities should be closed for both extension and modification
CSoftware entities should be open for modification but closed for extension
DSoftware entities should be open for both extension and modification
Step-by-Step Solution
Solution:
  1. Step 1: Recall OCP definition

    OCP states software should be open for extension but closed for modification.
  2. Step 2: Evaluate options

    Only Software entities should be open for extension but closed for modification matches the correct principle meaning.
  3. Final Answer:

    Software entities should be open for extension but closed for modification -> Option A
  4. Quick Check:

    OCP = open extension, closed modification [OK]
Quick Trick: OCP means add new features without changing existing code [OK]
Common Mistakes:
  • Reversing open/closed meanings
  • Thinking OCP forbids extension
  • Confusing OCP with other SOLID principles

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Software Engineering Quizzes