Bird
Raised Fist0

You want to provide a unified interface to a set of complex subsystems to simplify client usage. Which pattern should you apply?

easy🔍 Pattern Recognition Q2 of Q15
OOP & Design Patterns - Adapter vs Facade vs Proxy - Structural Pattern Comparison
You want to provide a unified interface to a set of complex subsystems to simplify client usage. Which pattern should you apply?
AProxy, to control access to the subsystems
BDecorator, to add features to subsystems dynamically
CAdapter, to convert subsystem interfaces to a common interface
DFacade, to provide a simplified unified interface
Step-by-Step Solution
Solution:
  1. Step 1: Understand the goal of simplifying client interaction

    The goal is to simplify client interaction by providing a unified interface.
  2. Step 2: Match pattern intent to unified interface

    Facade pattern provides a simplified unified interface to a set of interfaces in a subsystem.
  3. Step 3: Why other options are incorrect

    Proxy controls access but does not simplify multiple interfaces; Adapter converts interfaces but does not unify multiple subsystems; Decorator adds responsibilities but does not simplify interfaces.
  4. Final Answer:

    Option D -> Option D
  5. Quick Check:

    Facade = unified simplified interface [OK]
Quick Trick: Facade unifies; Adapter converts; Proxy controls access [OK]
Common Mistakes:
MISTAKES
  • Confusing Adapter with Facade
  • Thinking Proxy simplifies interfaces
  • Assuming Decorator unifies interfaces
Trap Explanation:
PITFALL
  • Candidates often mistake Adapter's interface conversion for Facade's simplification of multiple interfaces.
Interviewer Note:
CONTEXT
  • Checks understanding of Facade's role versus Adapter and Proxy.
Master "Adapter vs Facade vs Proxy - Structural Pattern Comparison" in OOP & Design Patterns

2 interactive learning modes - each teaches the same concept differently

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More OOP & Design Patterns Quizzes