Chapter 11. Implementing Software Design Patterns

In this chapter, we will cover the following topics:

  • Creating an array to object hydrator
  • Building an object to array hydrator
  • Implementing a strategy pattern
  • Defining a mapper
  • Implementing object-relational mapping
  • Implementing the Pub/Sub design pattern

Introduction

The idea of incorporating software design patterns into object-oriented programming (OOP) code was first discussed in a seminal work entitled Design Patterns: Elements of Reusable Object-Oriented Software, authored by the famous Gang of Four (E. Gamma, R. Helm, R. Johnson, and J. Vlissides) in 1994. Defining neither standards nor protocols, this work identified common generic software designs that have proven useful over the years. The ...

Get PHP 7 Programming Cookbook 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.