-
Book Overview & Buying
-
Table Of Contents
Learning Python Design Patterns - Second Edition - Second Edition
By :
We will now discuss the Proxy pattern with the help of the following UML diagram. As we discussed in the previous paragraph, the Proxy pattern has three main actors: the production house, Agent, and the Actor. Let's put these in a UML diagram and see how the classes look:

As we observe the UML diagram, you'll realize that there are three main participants in this pattern:
Proxy: This maintains a reference that lets the Proxy access the real object. It provides an interface identical to the Subject so that Proxy can substitute the real subject. Proxies are also responsible for creating and deleting the RealSubject.
Subject: It provides a representation for both, the RealSubject and Proxy. As Proxy and RealSubject implement Subject, Proxy can be used wherever RealSubject is expected.
RealSubject: It defines the real object that the Proxy represents.
From the data structure's perspective, the UML diagram can be represented as follows:
Proxy: It is a class...
Change the font size
Change margin width
Change background colour