7. Design Patterns

Once you begin regularly programming using objects, it’s not too long before you encounter the subject of design patterns. A design pattern is, simply put, a recommended best practice for solving a particular problem. In other words, if you’re trying to figure out how to implement such-and-such functionality, then use this design pattern as your approach.

This chapter introduces the concept of design patterns and walks you through four commonly used ones. Be forewarned that design patterns can be rather abstract, especially if the entire subject of OOP is still new to you.

Get PHP Advanced and Object-Oriented Programming: Visual Quickpro Guide, Third Edition 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.