18.2. UML

The following Unified Modified Language (UML) diagram details a class design using the Template Design Pattern (see Figure 18-1). The following list details this pattern:

  • The MyTemplate class has two public methods. The first is the final public method, named doCalculation(). This method will call the other method named logicA() to apply logic during the calculation. In MyTemplate, the method should be abstract.

  • The MyObject class extends the MyTemplate class. It actually contains the logic that the logicA() method in MyTemplate referred to.

Figure 18-1. Figure 18-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.