Bird
Raised Fist0

In a system using the Facade pattern to simplify interactions with multiple complex modules, what is the expected behavior when a client invokes a method on the Facade?

medium🧠 Technical Reasoning Q4 of Q15
OOP & Design Patterns - Adapter vs Facade vs Proxy - Structural Pattern Comparison
In a system using the Facade pattern to simplify interactions with multiple complex modules, what is the expected behavior when a client invokes a method on the Facade?
AThe Facade requires the client to manage the lifecycle of each module.
BThe Facade exposes all internal module interfaces directly to the client.
CThe Facade replaces the modules with simpler implementations.
DThe Facade coordinates calls to the underlying modules, hiding their complexity from the client.
Step-by-Step Solution
Solution:
  1. Step 1: Recall Facade purpose

    Facade provides a simplified interface to a set of complex subsystems.
  2. Step 2: Analyze client interaction

    The client calls the Facade, which internally manages subsystem calls.
  3. Final Answer:

    The Facade coordinates calls to the underlying modules, hiding their complexity from the client. -> Option D
  4. Quick Check:

    Facade simplifies subsystem usage [OK]
Quick Trick: Facade hides complexity behind a simple interface [OK]
Common Mistakes:
MISTAKES
  • Believing Facade exposes all subsystem interfaces
  • Confusing Facade with Adapter or Proxy
  • Assuming Facade replaces subsystems
Trap Explanation:
PITFALL
  • Options suggesting Facade exposes internals or replaces modules confuse its purpose.
Interviewer Note:
CONTEXT
  • Evaluates knowledge of Facade's role in simplifying subsystem interactions.
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