proxy mode , the method of accessing another proxy class (Realsubject) through a proxy class is abstracted into a interface class, also known as a subject Class (Subject).
Benefits : By accessing the methods in the proxy class, the method of implementing the class is indirectly accessed, that is, the method of the proxy class, which can enrich the extension in the proxy or the function of the original implementation method, to some extent, to understand the decoupling.
The implementation of the pattern, as stated above, has only three classes in the core, and the relationships between the three classes are shown in the class diagram:
The object A of the real topic class is constructed in the proxy class, so calling the operation method in the proxy class is called the method of A.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Mode of design: Proxy mode