Proxy
[structural-patterns][design-patterns]
The Proxy pattern suggests that you create a new proxy class with the same interface as an original service object. Then you update your app so that it passes the proxy object to all of the original object’s clients. Upon receiving a request from a client, the proxy creates a real service object and delegates all the work to it.
This pattern allows us to observe or do other stuff while we let the original object wrapped in the proxy do its own thing.
[Adapter] provides a different interface to the wrapped object, Proxy provides it with the same interface, and [Decorator] provides it with an enhanced interface.
[Decorator] and Proxy have similar structures, but very different intents. Both patterns are built on the composition principle, where one object is supposed to delegate some of the work to another. The difference is that a Proxy usually manages the life cycle of its service object on its own, whereas the composition of [Decorator]s is always controlled by the client.
[Facade] is similar to Proxy in that both buffer a complex entity and initialize it on its own. Unlike [Facade], Proxy has the same interface as its service object, which makes them interchangeable.