2150 inheritance Flashcards
1
Q
Specialization
A
“is-a” relationship, specialized form and may overried parent
ex - honda is a car
2
Q
Specification
A
- parent is abstract/superclass, subclasses implement the behaviour
- like specialization but subclasses fill holes left incomplement by parent
ex - interface in java
3
Q
Construction
A
- child inherits most/all functionality, changes behaviour to something different (sub. principle does not hold)
ex - implement a set class with class lIST
4
Q
Generalization
A
- modifies behaviour of superclass to be more general (opposite of specialization)
ex - vehicle is a superclass of car (bad idea)
5
Q
extension
A
- add new abilities (no overriding)
ex - stringset inherits from set, but adds string functionality as well
6
Q
limitation
A
- subclass behaviour is smaller/more restrictive than parent
stack is a subclass of generic list, but doesnt use generic list’s functions
7
Q
containment
A
“has-a” relationship, use one class as a data member
8
Q
variance
A
multiple classes have similar implementations, but no hierarchal relationship
9
Q
combination
A
> =2 parent classes, uses multiple inheritance