1. What problems could rise by making Quadrilateral and Rectangle subclasses of Polygon? What alternatives am possible? What are the advantages and disadvantages of each alternative?
2. Organize each of the following sets of items into inheritance hierarchies of classes.
Hints:
- For each set of items, you will have several distinct hierarchies.
- You will need to add additional classes to act as superclasses. You will also need to change some names, and you will discover that two items may correspond to a single class.
- Think of important attributes present in your classes. Make sure that attributes in a superclass will be present in each of its subclasses.
- Remember to use isa rule.
1) Vehicle, Car, Sports car, Airplane, Amphibious vehicle, Engine, Its engine, Electric motor, Wheel, Transmission, Truck, Bicycle.
2) Edition of book, Copy of book, Volume, Issue of newspaper, Magazine, Work of literature, Newspaper, Issue of magazine, Publication, Chapter, Author, Publisher, Copy of issue of magazine.
3. Imagine you are designing a reservation framework. This could be expanded into an application to reserve anything that needs reserving, e.g, dental appointments, meetings, tickets at the theater, the
1) Describe what services you might put in the framework. Answer this question using a simple list of things the system should be capable of doing.
2) What differentiating features would software developers need to provide to build specific applications?
3) What hooks and slots should therefore be available?