Design Patterns · Middle · Question 4 of 75
How does Adapter differ from Facade?
- ✓Correct answer: Adapter fits an interface to the expected one, Facade simplifies working with a subsystem
- 2Adapter simplifies a complex subsystem, while Facade changes the data format
- 3It's the same pattern, just called differently in different books
Explanation
An adapter usually wraps one object and makes it compatible with existing code. A facade defines a new, simpler interface over many objects. In practice, an API layer often combines both: a facade over HTTP and adapters for the data.