Skip to content

Latest commit

 

History

History
41 lines (38 loc) · 1.29 KB

proxy.md

File metadata and controls

41 lines (38 loc) · 1.29 KB

Proxy

The Proxy pattern provides a surrogate or placeholder for another object to control access to it. This is useful when there is a need for a more versatile or sophisticated reference to an object than a simple pointer.

Structure

   +--------+         +----------+
   | Client |-------->| Subject  |
   +--------+         +----------+
                      |Request() |
                      +----------+
                           ^
                           |
        +------------------^-----. . . . . . .
        |                  |
+-------+-------+     +----+-------+
|ConcreteSubject|     |  Proxy     |
+---------------+     +------------+    +--------------------------+
|Request()      |     |Request() *------|concretesubject->Request()|
+---------------+     +------------+    +--------------------------+

Participants

Tests