×

Loading...
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务

有没有正在学习OOdesign的朋友,大家一起做个练习, 看起来容易,但做起来好象并不简单

本文发表在 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
Report

Replies, comments and Discussions:

  • 工作学习 / IT技术讨论 / 有没有正在学习OOdesign的朋友,大家一起做个练习, 看起来容易,但做起来好象并不简单
    本文发表在 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
    • 作业?