Check out the new USENIX Web site. next up previous
Next: Conditions Up: Accessors Previous: Specifying methods

Avoiding type errors

Knowing the type of the fitting message objects is also useful for type checking. If all methods of an accessor are reified, the return type of each such Mi can be checked for its conformance to the type bound to Mi+1. Similarly, the type of each provided argument Pi,j can be checked for its conformance to the type of the j-th formal argument of Mi. By enforcing these checks, the Invoke class rules out type errors.[*] To enforce such checks without explicit use of reflection, message object types can also be specified by their name. This is illustrated in Section 4 through a small programming example.



Patrick Eugster
12/10/2000