next up previous contents index
Next: The Simulated Package Principle Up: Polymorphism by Virtual Domains Previous: Virtual Data Types and

 

Coercion Units

For each implementation of a domain that can be used as subdomain of some other domain we provide a renaming unit and a definition unit. The renaming unit together with the definition unit forms the coercion unit.

Including a coercion unit during the preprocessing step carries out all the renaming instructions from the renaming unit and defines the appropriate virtual data type. By conditional inclusion  of coercion units we make sure that we include exactly one coercion unit for each virtual domain. We will call these coercion units active  and those, which are not included, passive , respectively.

Depending on which unit is active, the virtual operations are mapped to operations in that particular implementation of the subdomain as depicted in Figure 1 and the virtual data type is mapped to (possibly) different data structures. 

   figure730
Figure 1: Interface between Domains   using Virtual Domains



windsteiger wolfgang
Thu Sep 3 14:50:07 MDT 1998