What is a typical trade-off when using the Facade pattern in a large system?
medium🪤 Complexity Trap Q6 of Q15
OOP & Design Patterns - Adapter vs Facade vs Proxy - Structural Pattern Comparison
What is a typical trade-off when using the Facade pattern in a large system?
AHigher memory usage due to duplicated subsystem objects
BIncreased complexity in client code due to multiple interfaces
CClients lose direct access to subsystem features, limiting flexibility
DSlower performance because Facade converts interfaces at runtime
Step-by-Step Solution
Solution:
Step 1: Understand Facade trade-offs on flexibility
Facade simplifies interfaces but hides subsystem details, reducing client flexibility.
Step 2: Why other options are incorrect
Increased complexity in client code due to multiple interfaces is false as Facade reduces client complexity; Higher memory usage due to duplicated subsystem objects is unrelated; Slower performance because Facade converts interfaces at runtime confuses Facade with Adapter.