本文选取电影订票系统,在理解需求的基础上进行业务领域建模Domain Modeling。
什么是领域模型?
领域模型是对领域内的概念或现实世界对象的可视化表示。领域模型是一种抽象系统,描述了知识,影响或活动领域的选定方面。 可以使用该模型来解决与该领域有关的问题。 领域模型表示与领域相关的有意义的实际概念,需要在软件中对其进行建模。 这些概念包括业务中涉及的数据以及与该数据相关的业务使用规则。
♦ 1) Collect application domain information
– focus on the functional requirements – also consider other requirements and documents
系统主要实现管理员对系统的管理操作和普通用户的订票支付两方面的功能需求。
♦ 2) Brainstorming
– listing important application domain concepts – listing their properties/attributes – listing their relationships to each other
attributes | |
theatre | address,name,price |
film | price,name,director,actor,language |
reserve | time,seat |
♦ 3) Classifying the domain concepts into:
– classes – attributes / attribute values – relationships
• association, inheritance, aggregation
将系统分为六个类,它们的关系如下:
theatre | theatre与film是关联关系,一个电影院放映多部电影 |
film | 与administrator、theatre是关联关系 |
reserve | reserve订票依赖于film和theatre |
administrator | 与film是关联关系 |
user | 与reserve和pay是关联关系 |
pay | 与user是关联关系 |
♦ 4) Document result using UML class diagram
原文:https://www.cnblogs.com/suseso/p/11930474.html