[comp.lang.eiffel] Eiffel, assertions, Object-Z an

johnson@p.cs.uiuc.edu (12/23/89)

>> Suppose we have the classes PLANE and ASSET.  From these we derive
>> COMPANY_PLANE.  A precondition for FLY in PLANE is to be a qualified pilot.
>> A precondition for USE in ASSET is to be a company employee.  Hence to
>> fly a company airplane, you must be a company employed qualified
>> pilot.  This strengthens the pre-conditions on both base classes.

This makes the assumption that flying a plane is using it.  Certainly
one does not have to be a pilot to use a plane; one could hire a pilot.
Moreover, a hired pilot might not be considered to be using the plane.
Thus, it is reasonable to have FLY and USE be entirely different.

However, if it is possible to change the type of pilot from "person
who is qualified to be pilot" to "person who is qualified to be pilot
and who is a company employee" then PILOT-TYPE needs to be a parameter
of the class.

Ralph Johnson