O'Reilly logo

PHP Objects, Patterns, and Practice, Second Edition by Matt Zandstra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required