Let's see the following UML diagram for this pattern:
UML diagram for Proxy design pattern
Now let's look at the different components of this UML diagram:
- Subject: Actual interface to be implemented by Proxy and RealSubject.
- RealSubject: Real implementation of Subject. It is a real object that represented by the proxy.
- Proxy: It is a proxy object and it is also the implementation of the real object Subject. It maintains the references to the real object.