Sequence Diagram Conceptual Diagram Use Case Activity Diagram | SuperBell Inc. sells communication services.
To place an order, customers can call a customer service representative (CSR),
who will fill the order (paper) form.
Orders will be entered into the system by an order entry clerk (OE Clerk).
Example of using UML by Yelena Gelfand. Instructor Jeff Zhuk |
The SuperBell company uses a Person object from which it inherits general information such as name and ID. From this, both Customers and Employees (CSR and OE Clerk) are inherited.
|
|||||||
Person | |||||||
![]() |
![]() |
||||||
Customer | Employee | ||||||
|
![]() |
![]() |
|
||||
OE Clerk | CS Rep. |
Inheritance is often represented as a tree. Moving down the tree, classes become more specialized, more honed toward an application. Moving up the tree, classes are more general; the contain members suitable for many classes but are often not complete.
Specialization | ![]() |
Generalization |
Objects rarely fall into completely distinct groups;there is often considerable overlap in the operations of object groups.
You might not always want a specialized subclass to inherit all the members of the superclass, or to inherit the members exactly as they are. To customize the members for a subclass, you can override superclass members. Overriding keeps the member but chenges the implementation.
You might need to override a method if the superclass provides a default implementation that is not optimal. Specific subclasses may override it to provide optimal implementations in light of the specific context in which they are used. For example,better algorithms or caching and storage techniques may be possible in specific derived classes.