Question: Using the Adapter examples found in this chapter, create a program as follows: 1. Implement a Citizen Data Base that stores various types of Humanoid
Using the Adapter examples found in this chapter, create a program as follows:
1. Implement a Citizen Data Base that stores various types of Humanoid instances (Orkan, Romulan, Earthling, and perhaps Martian). Decide whether you will use the private base class Adapter-Adaptee relationship or the association relationship between the Adapter and Adaptee (hint: the private inheritance version will be easier).
2. Noting that the Citizen Data Base handles Person instances, can this class be used as-is to store various types of Humanoid instances, or must it be adapted in some way? Recall thatPerson is a base class of Humanoid (if you chose this implementation), but also remember that we can never upcast past a non-public inheritance boundary.
Step by Step Solution
3.39 Rating (158 Votes )
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
