8.2. UML

This Unified Modified Language (UML) diagram details a class design using the Façade Design Pattern (see Figure 8-1).

Figure 8-1. Figure 8-1

For this diagram, note the following:

  • The MyObject class contains a public method called doSomethingRequiresAandB(). This is just one step in the execution of the MyObject class. doSomethingRequiresAandB() creates a new instance of the object LogicFacade. It calls the public method named callRequiredLogic(), which is named abstractly enough for MyObject.

  • The callRequiredLogic() method inside the LogicFacade class is then responsible for creating an instance of LogicObjectA and calling the doSomethingA() method. It also is responsible for creating an instance of LogicObjectB and calling the doSomethingB() method.

  • All of these actions are passed back through the LogicFacade class so that they are available to MyObject.

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.