|
643 Week 8/15 Outline: Class Diagrams
Posted on 3/2/2024) by Liping Liu
(643 Week 8/15 Outline: Class Diagrams) Class Diagram: A graphical model representing conceptual objects and their relationships
Two Types of Relationships:
Inheritance:
Instance Level: Child objects are special kinds of a parent object (is-a relationship)
Class Level: Child classes are sub classes of a parent class
Wrong: A child object is contained in a parent object (why?)
Example 1:
Employee, FullTimer, and PartTimer
Account, Checking, and Savings
Encapsulation Principle Revisit:
private data for parent class must be changed into protected one
behavioral members must be changed into virtual if child class needs to change their implementation... more >>
|