O'Reilly logo

Design Patterns in Java™, Second Edition by William C. Wake, Steven John Metsker

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

25 Interpreter

AS WITH THE COMMAND pattern, the INTERPRETER pattern produces an executable object. The patterns differ in that INTERPRETER involves the creation of a class hierarchy in which each class implements, or interprets, a common operation in a way that matches the class’s name. In this regard, INTERPRETER is similar to the STATE and STRATEGY patterns. In INTERPRETER, STATE, and STRATEGY, a common operation appears throughout a collection of classes, with each class implementing the operation in a different way.

The INTERPRETER pattern is also similar to the COMPOSITE pattern, which defines a common interface for individual items and groups of items. COMPOSITE does not require different, interesting ways of forming groups, although ...

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