The Proxy design pattern provides a solution:
Define a separate Proxy object that acts as substitute
for another object (Subject).
Work through a Proxy object
to control the access to a real subject.
Describing the Proxy
design in more detail is the theme of the following sections.
See Applicability section for all problems Proxy can solve.
Proxy object
that performs additional functionality when accessing
an (already existing) object.
Subject interface
so that it can act
as substitute wherever a subject is expected.
Clients do not know whether they are working
with a real subject
or its proxy.
Proxy object:
Proxy)
that implements arbitrary functionality to
control the access to a
RealSubject object.