Name compatible modifications
- operational semantics -- no extra compile/run-time checks
procedure search(name, module)
if name = action then do action
elsif inherited = nil
then undefined
else search(name, inherited)
slide: The inheritance search algorithm
Name compatible modifications
Name compatible modifications approximate behaviorally
compatible modifications in the sense that
substitutability is guaranteed, albeit not in a semantically
verifiable way.
Operationally, substitutability can be enforced
by requiring that each subclass (that we may characterize
as a pragmatic subtype) provides at least the operations
of its superclasses
(while giving a sensible result on all argument types
allowed by its superclasses).
Actually, name compatibility is an immediate consequence of
the overriding semantics of derivation by
inheritance, as reflected in the search algorithm underlying
method lookup.
See slide [8-search].
Although name compatible modifications are by far the most flexible,
from a theoretical point of view they are the least satisfying
since they do not allow for any theory formation concerning
the (desired) behavior of (the components of) the system
under development.