Project 1 - Phase 2
Inheritance
- Motivation
- Inheritance (and interfaces) are Java's answer to
union
.
- Inheritance is the natural way to solve OP problem.
- Implementation
- Used reflection to dynamically instantiate subclasses based on name
- Realized in retrospect that a Factory Method may have been
better
- Diagram
- To be fixed
- Remove the "abstract" attribute.
- Change extends subclass to inherits interface