Facade
The odd one of the four wrappers: it preserves no existing interface, it invents a simpler one in front of a subsystem. That is also how you tell it from Adapter – an adapter matches an interface someone else defined, a facade defines its own.
Structure
classDiagram
class Client
class Facade {
+simpleOperation()
}
class SubsystemA {
+opA()
}
class SubsystemB {
+opB()
}
class SubsystemC {
+opC()
}
Client --> Facade
Facade --> SubsystemA
Facade --> SubsystemB
Facade --> SubsystemC
Telling It Apart
Patterns whose structure looks the same but whose intent does not. See the Confusing Pairs reference.
- Adapter — Change an interface so two otherwise incompatible things can work together.