CHAPTER 11Performing and Representing Tasks

In this chapter, we get active. We look at patterns that help us to get things done, whether interpreting a minilanguage or encapsulating an algorithm.

This chapter will cover

  • The Interpreter pattern: Building a minilanguage interpreter that can be used to create scriptable applications
  • The Strategy pattern: Identifying algorithms in a system and encapsulating them into their own types
  • The Observer pattern: Creating hooks for alerting disparate objects about system events
  • The Visitor pattern: Applying an operation to all the nodes in a tree of objects
  • The Command pattern: Creating command objects that can be saved and passed around

The Interpreter Pattern

Languages are written in other languages ...

Get PHP Objects, Patterns, and Practice, Second 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.