Java Reference
In-Depth Information
composition rule determines how the class implements, or interprets, an operation that you
distribute throughout the hierarchy.
The operation in an interpreter is often named
execute()
or
evaluate()
. The operation
name is necessarily vague, becoming meaningful only when combined with the name of the
class that implements it. Like S
TATE
, S
TRATEGY
, and C
OMMAND
, the I
NTERPRETER
pattern
fixes the name of an operation and uses various classes to implement the operation.
I
NTERPRETER
applies this idea to let you compose executable objects according to a set of
composition rules that you define.