Chapter 5. Behavioral Design Patterns

Behavioral design patterns are all about the communication between objects.

Bearing in mind the Single Responsibility Principle, it is vital that classes only encapsulate one responsibility. Given this, there is clearly a necessity to allow objects to communicate.

By using Behavioral design patterns, we are able to increase the flexibility by which we conduct these communications.

In this chapter, we'll cover the following patterns:

  • Observer pattern (SplObserver/SplSubject)
  • Iterator
  • The many Iterators of PHP
  • Generators
  • Template pattern
  • Chain of Responsibility pattern
  • Strategy pattern
  • Specification pattern
  • Scheduled Task pattern

Personality traits for passionate programmers

Before we start talking about Behavioral design ...

Get Mastering 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.