A Simple OO Design Task
Task
Extract the "isa" (class, inheritance), "has" (attributes),
"uses" (asssociations), and
"does" (methods) in the following design.
-
Persons have up to 4 employees. Owners can own several cars. Cars can be financed by several loans. Banks loan to persons, companies, and other banks
- The current procedural design follows. Max it "OO".
Hints: replace pointers with associations; get multiplicities right;
eliminate IDs; ?? add classes.
-
"Person":
name
age
employer 1 ID
employer 2 ID
employer 3 ID
person ID
address
-
"Car":
owner ID
vehicle ID
owner type
model
year
-
"CarLoan":
vehicle ID
customer type
customer ID
account number
band ID
interest rate
current balance
-
"Company":
name
company ID
-
"Bank":
name
bank ID
Solution
Comments
-
Persons have < 4 employees: ignored (? artificial).
- Account number left in: why?
- Any extra sub-classing we can do?
- Are any relationships redundant?