Proxy
Structurally identical to Decorator, with a different job: the same face, controlled access. If you are adding behavior it is a decorator; if you are deciding whether, when, or for whom the original behavior runs, it is a proxy.
Structure
classDiagram
class Subject {
<<interface>>
+request()
}
class RealSubject {
+request()
}
class Proxy {
-real: RealSubject
+request()
}
Subject <|.. RealSubject
Subject <|.. Proxy
Proxy o--> RealSubject : controls access to
Telling It Apart
Patterns whose structure looks the same but whose intent does not. See the Confusing Pairs reference.