Generalization, Specialization, and Inheritance - The Process - The Generalization Process
3 important questions on Generalization, Specialization, and Inheritance - The Process - The Generalization Process
When you have several classes with similar attributes and similar behaviors, you can look for....?
Consider that a jurisdiction may have licensing procedures for dogs, cats, tigers, snakes, and alligators.
Instead of treating them all separately, you could also...?
You could create a Pet class—Allowing a loop through all the pets during renewal season without making separate loops for each subclass.
If the details of getting or renewing a license were different for each subclass, you would define an abstract operation on the Pet class called renewLicense().
What would each subclass have then?
However, the users of the Pet class would not have to deal with the details and would not need to know what type of Pet is currently being handled.
The question on the page originate from the summary of the following study material:
- A unique study and practice tool
- Never study anything twice again
- Get the grades you hope for
- 100% sure, 100% understanding