Chapter 18. Template Pattern

The phrase "too many cooks in the kitchen" has been used by me a few times when examining a new code base. Whether because of time constraints or to use developers' strengths in areas where they excel, there are often times when a set of similar functionalities in development are broken up between programmers and teams. Unfortunately, this sometimes generates inconsistencies in the public interfaces of some of the programming. Superiorly architected code bases dictate base classes to build individual functionality from. To create these base classes, which enforce a specific set of interfaces and behavior, the Template Design Pattern is the way to go.

Name: Template

The Template Design Pattern creates an abstract object that enforces a set of methods and functionality that will be used in common by child classes as a template for their own design.

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.