180 likes | 575 Views
Classification, Generalization, and Specialization. Classification. Objects with similar definitions have been grouped and defined into classes. The act of identifying and categorizing similar objects into classes is known as classification in object-oriented modeling.
E N D
Classification • Objects with similar definitions have been grouped and defined into classes. • The act of identifying and categorizing similar objects into classes is known as classification in object-oriented modeling.
Classification • We will group the animals based on their commonality with one another. • Mighty, Flipper, Willy, Janet, Jeremy, Bunny, and Smudge. These objects are grouped together into the Mammal category because they share some common information typical of a mammal: • their young are born alive; • they are warm-blooded; • they breathe through their lungs; and • their bodies are covered with hair.
Classification • Similarly, Parry, Heather, Wise, and Swift are grouped into a Bird category because they share common information typical of a bird. • In a like manner, we group: • Angel and Jaws into a Fish category; • Sally and Lily into a Reptile category; • Beatle and Ben into an Insect category; and • Kermit into an Amphibian category.
Hierarchical Relationship of Classes • Classes formed can be organized in a hierarchical manner. • Depending on the position of a class in the hierarchy, it may be known as a superclass or a subclass of a class. • A specialized class is known as a subclass of a class while the generalized class is known as a superclass of a subclass in object-oriented terms.
Generalization • Generalization is the act of capturing similarities between classes and defining the similarities in a new generalized class; the classes then become subclasses of the generalized class.