5.1 领域模型
领域模型 Domain Model
什么是领域模型
一种概念模型,问题领域的概念的表示
A conceptual model,a representation of concepts in a problem domain
如何表示领域模型
简单地说, “没有定义操作的类图”
模型显示:概念类、概念类之间的关系、概念类的属性
为何需要领域模型 Why domain Model
Domain model can inspire some software design 领域模型可以作为 设计某些软件对象 的灵感来源
Use case, expert’s opinions are the input of creating domain model 用 例概念、专家观点是 创建领域模型的输入
领域模型又 会影响操作 契约、词汇 表和设计模 型,尤其是 对软件对象
LRG:Low Represent ation Gap 减少与OO 建模之间的 表示差异
如何创建领域模型 how to create
三步骤
Find conceptual classes
Add associations
Add attributes
复习:What is concept class?
an idea, thing, or object in the problem domain
复习:how to Identify Concepts
概念模型
Reuse or modify existing models
Finding Concepts with the Concept Category List
Finding Concepts with Noun Phrase Identification
分析模型 stereotype of class [boundary/entity/control]
CRC
理解概念类的三个层面
Symbol (符号、表象):
word or images representing a conceptual class
Intension (内涵):
the definition of a conceptual class
Extension (外延):
the set of examples to which the conceptual class applies
领域模型与数据模型 Domain Model vs. Data Model
Domain Model
Concepts, entities, can be abstract
Relations
Attributes
Data Model
How data is stored into persistent storage
Pure data, in files or databases