Day 8 -- Outline
I. Inheritance for IS A
A. Use example from Homework
Event HAS SUBPARTS
[0:a] Date [1:*];
END;
Standard Event, Temple Event IS A [PARTITION] Event;
Standard Event HAS SUBPARTS
[0:b] Location [1:*];
[a+b>0 AND a <= 1 AND b <= 1];
END;
Temple Event HAS SUBPARTS
[0:b] Temple [1:*];
[a+b>0 AND a <= 1 AND b <= 1];
END;
Birth, Death, Live Baptism, Civil Marriage IS A
[PARTITION]bStandard Event;
Temple Marriage, Marriage Sealing, Child to Parent Sealing,
Temple Baptism, Endowment IS A [PARTITION] Temple Event;
Live Baptism, Temple Baptism IS A Baptism;
Civil Marriage, Temple Marriage IS A Marriage;
B. Ordered Sequence IS A Sequence -- Need protected Inheritance
1. No Class Migration
C. Private Inheritance ? -- Often used for reuse and not IS A
D. Virtual methods
1. Implementation Model
2. What are Virtual Methods
3. Need Pointers
a. Why?
4. Event* e;
b. e->print_place();
5. Reduce Switch Statements
6. Why won't it work with reads?
E. Pure Virtual Methods and Abstract Classes
1. Is an Event Abstract?
2. pure virtual place
Last updated 30 Apr 1996