Proxy pattern

A proxy, in its most general form, is a class functioning as an interface to something else.

The proxy could interface to anything: a network connection, a large object in memory, a file, or some other resource that is expensive or impossible to duplicate.

Use of the proxy can simply be forwarding to the real object, or can provide additional logic.

In the proxy, extra functionality can be provided, for example caching when operations on the real object are resource intensive, or checking preconditions before operations on the real object are invoked.

In place of a complex or heavy object, a skeleton representation may be advantageous in some cases.

A sample UML class and sequence diagram for the Proxy design pattern. [ 3 ]
Proxy in UML
Proxy in LePUS3 ( legend )