





























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The concept of composite figures and their implementation using multiple inheritance. It provides examples of composite figures derived from simple figures and discusses the notion of composite figures, their features, and merging. The document also covers name clashes and their resolution, as well as the special case of repeated inheritance.
Typology: Papers
1 / 37
This page cannot be seen from the preview
Don't miss anything!






























TRAIN_CAR,
RESTAURANT
DINER?
A composite figure
Simple figures
moverotatehidedisplay
removeputcount
class
COMPOSITE_FIGURE
inherit
FIGURE
redefine
display,
move,
rotate, ...
end
LIST [
FIGURE]
feature
display
is
-- Display each constituent figure in turn.
do
from
start
until
after
loop
item.
display
forth
end
end
... Similarly for
move,
rotate etc. ...
end
Multiple inheritance: Combining abstractions
Result
foo
foo
foo
foo
rename
foo
as
fog
rename
foo
as
zoo
f*
f*
f+
class
D
inherit
A
rename
g
as
f
end
C B
rename
h
as
f
end
feature
...
end
g
f
h