本文发表在 rolia.net 枫下论坛Exercise 4:Complex Operations
Exercise objective – To apply the concept of complex operations in
design.
Preparation
Make sure you understand the concepts discussed so far in this
module.
Tasks
Consider a Car Insurance company that needs to calculate insurance
premiums. The algorithms are numerous and each one is complicated.
The following are just a few of the cost adjustment factors:
l Type of vehicle (needs calculate basic price from vehicle tables)
l Modifications to vehicle for example added turbo charger (need to
calculate adjustment from tables)
l Location of vehicle (need to calculate adjustment from post code
tables)
l Age of Vehicle (...)
l Age of named driver (...)
l Convictions for named drivers (...)
1. You need to design the bare bones of a design structure to
calculate premiums. It must be flexible, for example you can easily
add new cost adjustment factors.
2. Use the partial analysis class diagram below as you starting point.
Redraw adding classes as required, drawing associations,
inheritance, composition as appropriate.
Person –abstract class
CarDriver – extend person, and has aggregation relation with insurance policy
Cardetails – has aggregation relation with insurance policy
InsuracnePolicy更多精彩文章及讨论,请光临枫下论坛 rolia.net
Exercise objective – To apply the concept of complex operations in
design.
Preparation
Make sure you understand the concepts discussed so far in this
module.
Tasks
Consider a Car Insurance company that needs to calculate insurance
premiums. The algorithms are numerous and each one is complicated.
The following are just a few of the cost adjustment factors:
l Type of vehicle (needs calculate basic price from vehicle tables)
l Modifications to vehicle for example added turbo charger (need to
calculate adjustment from tables)
l Location of vehicle (need to calculate adjustment from post code
tables)
l Age of Vehicle (...)
l Age of named driver (...)
l Convictions for named drivers (...)
1. You need to design the bare bones of a design structure to
calculate premiums. It must be flexible, for example you can easily
add new cost adjustment factors.
2. Use the partial analysis class diagram below as you starting point.
Redraw adding classes as required, drawing associations,
inheritance, composition as appropriate.
Person –abstract class
CarDriver – extend person, and has aggregation relation with insurance policy
Cardetails – has aggregation relation with insurance policy
InsuracnePolicy更多精彩文章及讨论,请光临枫下论坛 rolia.net