15.2. UML

This Unified Modified Language (UML) diagram details a class design using the Proxy Design Pattern (see Figure 15-1). Note the following concerning this pattern:

  • MyObject is the base object that clients normally interact with. It has one public method, called doSomething().

  • MyProxyObject is the Proxy for MyObject. It contains one public method, named doSomething(), and one protected one, named provideProxyFeature().

  • When MyProxyObject is substituted in for MyObject, the doSomething() method still can be called. MyProxyObject executes the provideProxyFeature() method before possibly forwarding the request to the doSomething() method of MyObject.

Figure 15-1. Figure 15-1

Get Professional PHP Design Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.