Domain Model Scar Booth 20141008 20141015 Day 1
軟體 程 -Domain Model 講師:蘇瑞亨 Scar 助教:洪加壐 Booth 2014/10/08 2014/10/15
課程大綱 Day 1 什麼是Domain Model 如何做Domain Model Homework(分組) Day 2 分組練習與討論 5
Zachman Architecture Framework 6
Model vs. Reality 8
Benefits from Domain Modeling ü Make systems simpler and easier ü Make changes cheaper and easier ü Make business more agile and adaptive ü Data Models are only a small part of the system with high impact 12
Domain Model, How? 語法 配置 語意 15
語法 ü 常見表示法 p Information Engineering p Unified Modeling Language (UML) p Barker/Oracle/SSADM 16
常見表示法-1 Information Engineering: must be one exactly one or more has may be sells in 17
常見表示法-2 UML must be one or more must be one exactly line. Item +product. Type: St ring 1. . * +Quantity: Numb er +Price: Money may be one or more purchase. Order 1. . 1 has Data type is shown Party +PO_number: Inte ger 1. . 1 0. . * +PO_Date: Date Is vendor in +Terms: String Visibility is shown +name: String +party. Type: Str ing 19
常見表示法-3 Barker/Oracle/SSADM opposite must be one or more one and only one opposite may be 20
常見表示法彙整 mandatory, one optional, many 0. . * 1. . 1 UML mandatory, one optional, many Information Engineering Opposite side is mandatory Opposite side is optional many one 21 Oracle / Barker
表示法元素 Entity Class Unique Identifier Attribute 表示法 元素 Relationship Arc Sub-type & Super-type 22
表示法元素-Attributes ü 對Entity classes的辨識、描述、量化 25
如何解讀Relationship 27
現學現賣 ü Each LINE ITEM must be part of one and only one ORDER. ü Each PURCHASE ORDER may be composed of one or more LINE ITEM(S). 28
表示法元素-Sub-types & Super-types ü 每個在sub-type裡的案例也都是其super-type的一個 案例 ü 在super-type裡的每個案例必須是一個且僅能是一個 sub-type裡的案例 ü 相互獨立,完全窮盡 (MECE) Mutually Exclusive Collectively Exhaustive ü Sub-type 繼承其super-type的屬性與關係 ü Sub-type不會繼承其它sub-type的屬性 29
資料表元素-Arc Each LINE ITEM must be for either one PRODUCT or one SERVICE. Mutually Exclusive Collectively Exhaustive 30
表示法元素-Unique identifier 由 1個或多個 attributes 由 1個或多個 relationships 由兩者一起指定 (two relationships) (attribute only) 31 (relationship + attribute)
33
表示法元素-重點整理 Entity Class Unique Identifier Attribute 表示法 元素 Relationship Arc Sub-type & Super-type 35
Domain Model, How? 語法 配置 語意 36
畫面配置原則 ü Entity 的對齊 p Entities 之間至少有一邊對齊 p Reference entity偏右偏下 p Transaction entity偏左偏上 ü Relationship的安排 p 垂直或水平,避免斜線 p 避免直角 p 將relationship平均分配在Entity的邊上 37
大家來找碴 ü Entity 的對齊 p Entities 之間至少有一邊對齊 p Reference entity偏右偏下 p Transaction entity偏左偏上 ü Relationship的安排 p 垂直或水平,避免斜線 p 避免直角 p 將relationship平均分配在 Entity的邊上 38
Better? 39
Domain Model, How? 語法 配置 語意 41
語意 ü 常見的Pattern p People & Organization p Recursive p Party Role 42
語意-People & Organization Each EMPLOYMENT must be of one PERSON; Each PERSON may be in one or more EMPLOYMENTS Each PERSON may be employed by one and only one ORGANIZATION over time? 44
Position 45
語意 ü 常見的Pattern p People & Organization p Recursive p Party Role 46
語意-Recursive 47
Recursive 49
Recursive Pattern 50
語意-Recursive 51
組織架構基礎模型 PARTY RELATIONSHIP PARTY from parent in to child in POSITION ASSIGNMENT EMPLOYMENT of * START DATE o END DATE source of * FROM DATE o UNTIL DATE o NAME (SURNAME) PERSON o FIRST NAME o BIRTH DATE o CHARGE RATE by employed in to with object of employer in POSITION # ID o NAME ORGANIZATION o PURPOSE defined by definer of 54
語意 ü 常見的Pattern p People & Organization p Recursive p Party Role 55
語意-Party Role 56
語意-Party Role 57
還好有大師先想好了 Domain Model Patterns 的寶藏庫 65
Data Model Resource Book I ü People and Organization ü Products ü Orders ü Shipments ü Work Efforts ü Invoices ü Accounting ü Human Resources ü … 66
萬用Model 67
69
Thanks www. gss. com. tw
- Slides: 73