Title: Exercises
1Exercises
- Each customer can buy multiple insurance
products. - The properties of each insurance product
- Product ID, product name, insurers name,
deductible, annual premium, the total amount of
payments, policy number, agents name, policy
term (e.g., 09/01/07 to 08/31/08) - Each customer can have multiple credit cards.
- The properties of each card
- Card type (e.g., basic, gold, platinum), monthly
credit limit, monthly expenses, annual expenses,
payment address, customer service phone number,
cashing limit, finance charge APR - Each customer can rent a car.
- The properties of each car
- Vehicle ID, make, model, year, color, of
rentals ( of customers who have rented each
car), mileage.
2Exercises
- Each customer can buy multiple insurance
products. - The properties of each insurance product
- Product ID, product name, insurers name,
deductible, annual premium, the total amount of
payments, policy number, agents name, policy
term (e.g., 09/01/07 to 08/31/08)
Policy
InsuranceProduct
- policyNum int - deductible float -
annualPremium float - totalPayments float -
agentName String - policyTerm Date2
1
0..
- productID int - productName String -
insurerName String
- policies
- product
0..
- policies
1
- insured
Insured
3- Each customer can have multiple credit cards.
- The properties of each card
- Card type (e.g., basic, gold, platinum), monthly
credit limit, monthly expenses, annual expenses,
payment address, customer service phone number,
cashing limit, finance charge APR
CreditCard
CreditAccount
- customerServPhone - paymentAddr Address -
cardIssuer String - cardType ltltenumgtgtCardType
1
0..
- creditLimit float - moExpenses float -
annualExpenses float - cashingLimit float -
apr float
- accounts
- card
0..
- type
1
0..
- accounts
ltltenumerationgtgt CreditType
1
- cardHolder
BASIC GOLD PLATINUM BUSINESS
Customer
4- Each customer can rent a car.
- The properties of each car
- Vehicle ID, make, model, year, color, of
rentals ( of customers who have rented each
car), mileage.
Vehicle
VehicleSpec
1
0..
- vid int - rentalNum int - mileage float
- make ltltenumgtgtMake - model ltltenumgtgtModel -
year int - color ltltenumgtgtColor
- vehicles
- spec
0..
- vehicles
0..1
- customer
Customer
5Revising an Example Rental Video Model
VideoTape
Title
- tapeId int - rented boolean - numRental int
- id int - title String - rentalCost double -
directorNameString
0..
1
isRented() boolean rent() void
0..10
Customer
0..1
- Each customer can rent up to 10 video a day.
- How can we record each customers rental history?
6VideoTape
Title
- tapeId int - rented boolean - numRental int
- id int - title String - rentalCost double -
directorNameString
0..
1
- title
- tapes
isRented() boolean rent() void
1..10 - tapes
Rental
- rentalDate Date - returnDate Date -
totRentalCost double
0.. - rentals
- rentalHistory
0..
- customer
Customer
1
7- Do we really need to model a particular
(physical) video tapes?
Title
- id int - title String - rentalCost double -
directorNameString - numRentals int -
totAvailTapeNum int - availTapeNumint
Rental
- rentalDate Date - returnDate Date -
totRentalCost double
0..
1
0..
Customer
1
8- Maybe
- Rigorous property management
- When each tape is purchased/disposed.
- How many tapes are owned currently.
- Quality management for tapes
- Disposing a tape when it has been rented certain
times. - Sharing tapes among branch shops
- Maybe not
- Simpler property management