Control the access to an object.
The example creates first an interface against which the pattern creates the classes. This interface contains only one method to display the image, called
displayImage(), that has to be coded by all classes implementing it.
The proxy class
ProxyImage is running on another system than the real image class itself and can represent the real image
RealImage over there. The image information is accessed from the disk. Using the proxy pattern, the code of the
ProxyImage avoids multiple loading of the image, accessing it from the other system in a memory-saving manner.