COMP371 Lab #3 案例展示:领域模型和系统顺序图
编辑COMP371 Lab #3 案例展示:领域模型和系统顺序图
COMP371 Lab # 3 (10 marks)
Domain Model and System Sequence Diagrams
Due: October 06, 11:59 PM
Deliverables:
(5 marks) Design and draw the Domain Model for the case below. You can use reasonable assumptions for missing details.
(5 marks) Design and draw the SSD for the customer and the system above. You can drop some minor steps and keep the major ones. For example, adding an item to the online cart is central; the system asks if checking out is minor.
This week’s class introduced the Domain Model (DM) and System sequence diagrams (SSD). Recall the two samples we had used in the class. To create a domain class, we must find the conceptual classes, draw them as classes in a UML class diagram and add associations and attributes. The SSD mainly shows the details of events generated by actors and within the system in order. SSD is an integral part of the UP Use case model, created during the elaboration phase. For more information, please see Chapter 9 in your textbook. You can use Figures 9.17, 9.27, and 31.19 in your textbook as examples for your Domain Model.
In this lab assignment, let's create a DM (see Ch.9) and an SSD (see Ch. 10) for a simple sales system.
“The sales system involves the customer, sale, sales items, products, promotion, and accessories. Each customer can be associated with one or more sales. There are multiple types of sales (e.g., in-store, online and telephone sales). The customer will use an online shopping cart to store the selected items for online sales. Each sale is associated with one or more items. With the online sale, the items are placed in the online cart first and then checked out. A sale transaction for all types of sales is created once the sale is completed. The Item may have promotions, and the customer can place a comment on them without any purchases. The inventory tracks all items.”
Please submit both files on Blackboard before the due date. The designs must be made using software—no hand drawings.
作业目标
本次实验旨在设计并绘制一个简单销售系统的 领域模型 (Domain Model, DM) 和 系统顺序图 (System Sequence Diagram, SSD)。领域模型是描述系统的概念类和类之间关系的图,而系统顺序图则展示了由用户(顾客)和系统之间的交互生成的事件顺序。
作业要求
- 领域模型设计 (5分):根据给出的案例信息,设计一个领域模型,识别系统中的概念类,并绘制 UML 类图,添加关联关系和属性。
- 系统顺序图设计 (5分):为顾客和系统设计一个系统顺序图,展示系统和顾客之间主要的交互步骤。
案例描述
销售系统涉及以下实体:
- 客户 (Customer): 每个客户可以有一个或多个销售记录。
- 销售 (Sale): 销售有多种类型,例如店内销售、在线销售和电话销售。
- 销售项目 (Sale Item): 每次销售可以包含一个或多个项目。在线销售时,客户可以将项目放入购物车中,然后进行结算。
- 产品 (Product): 销售系统中的商品可以有促销信息,且顾客可以对商品发表评论,即使未进行购买。
- 促销 (Promotion): 针对某些商品的优惠活动。
- 配件 (Accessory): 产品的附属配件。
- 库存 (Inventory): 负责跟踪所有的项目。
在本实验中,要求为以上实体创建领域模型 (DM) 和系统顺序图 (SSD)。
步骤 1: 领域模型设计 (Domain Model)
领域模型设计的核心是识别系统中的概念类、它们之间的关联关系以及关键的类属性。以下是该案例的领域模型设计步骤:
概念类:
- Customer: 代表客户,包含客户信息。
- Sale: 代表销售记录,包含销售的类型和相关信息。
- Sale Item: 销售中涉及的具体项目。
- Product: 代表系统中的商品。
- Promotion: 商品的促销信息。
- Accessory: 产品的附属配件。
- Inventory: 跟踪商品库存。
类之间的关联:
- Customer 与 Sale: 一个客户可以有多个销售记录。
- Sale 与 Sale Item: 每次销售可能包含一个或多个销售项目。
- Sale Item 与 Product: 每个销售项目对应一个产品。
- Product 与 Promotion: 产品可能有促销活动。
- Product 与 Accessory: 产品可以有一个或多个附属配件。
- Product 与 Inventory: 库存管理跟踪产品数量。
类的属性:
- Customer:
id
,name
,email
,address
- Sale:
id
,type
,date
,totalAmount
- Sale Item:
id
,quantity
,price
- Product:
id
,name
,description
,price
- Promotion:
id
,description
,discount
- Accessory:
id
,name
,productId
- Inventory:
productId
,quantity
步骤 2: 系统顺序图设计 (System Sequence Diagram)
系统顺序图展示了顾客与系统之间的主要交互步骤。在这个销售系统中,顾客主要的操作包括:浏览商品、将商品加入购物车、结算并生成销售记录。
系统交互步骤:
- 顾客登录:顾客通过账号登录系统。
- 浏览商品:顾客可以浏览商品信息,包括促销和配件信息。
- 添加商品到购物车:顾客选择商品并添加至购物车。
- 查看购物车:顾客查看购物车内的商品。
- 结算:顾客完成支付,系统生成销售记录并更新库存。
SSD 示例:
- 顾客请求查看商品列表,系统返回商品信息。
- 顾客选择商品并将其添加到购物车,系统确认商品已添加。
- 顾客请求查看购物车内容,系统返回购物车详情。
- 顾客进行结算,系统处理付款并生成销售记录。
- 系统更新库存并返回购买确认信息给顾客。
提交说明
- 请在 Blackboard 上提交两个文件:
- 领域模型 (Domain Model):绘制的 UML 类图,展示系统中的类、属性和关联关系。
- 系统顺序图 (System Sequence Diagram):展示顾客与系统的主要交互步骤。
注意: 设计图必须使用软件工具绘制,不接受手绘图。推荐使用 UML 设计工具(如 Lucidchart、Draw.io 或 Visual Paradigm)。
评分标准:
- 领域模型 (Domain Model) 设计 (5 分):识别正确的概念类、属性及类之间的关系,并绘制清晰的类图。
- 系统顺序图 (SSD) 设计 (5 分):设计清晰的顺序图,展示顾客与系统的交互流程,确保交互步骤逻辑合理,重点突出。
联系我们
WeChat:pythonyt001
Email: [email protected]
- 0
-
分享