12.2 Classification


12.2 Classification

Classification is a modeling concept, and for a given application, it refers to the grouping of the objects with common characteristics. In this activity, the classes and their relationships are identified. Some classes of an application are completely independent—only the class with function main has a relationship with them. The other classes in the application are related in some manner and they form a hierarchy of classes.

In a class hierarchy, the most general class is placed at the top. This is the parent class and is also known as the super class (or the base class). A derived class inherits the characteristics (all attributes and operations) of its parent class. A derived class can be further inherited to lower-level classes. In the UML class diagram, an arrow with an empty head points from a subclass (the derived class) to its base class to show that it is inheriting the features of its base class. Because in the UML diagram, the arrow showing this relationship points from the subclass up to the base class, inheritance is seen as a vertical relationship between two classes (see Figure 12.1).

click to expand
Figure 12.1: An inheritance relationship.




Object-Oriented Programming(c) From Problem Solving to Java
Object-Oriented Programming (From Problem Solving to JAVA) (Charles River Media Programming)
ISBN: 1584502878
EAN: 2147483647
Year: 2005
Pages: 184

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net