Next: Consequences
Up: Design Pattern: Translator
Previous: Participants
Collaborations
Figure 5 shows important object interactions. It
refers to ``@'' for an infix function application syntax (see sample
code in section 2.9).
- A client initializes a function package in order to create a generic
function from it. The client
applies
the generic function to the source
structure in order to obtain the translation result.
- The generic function consults the function package for a specialized
function that matches the type of the argument. Then it applies a cloned
exemplar of the specialized function to the argument.
- A specialized function recursively calls its associated generic
function to the subcomponents of its argument. Then it creates the target
element while providing it with the results of the subcomponent evaluation.
Figure 5:
Interaction diagram
 |
Note that the time line gaps in figure 5
denote potential recursive mappings of subcomponents.
Thomas Kuehne
1998-07-06