K.NET講師 Clark
 Microsoft MVP
 部落格:昏睡領域
http://www.dotblogs.com.tw/clark/
 技術專長:
◦ 領域驅動設計流程
◦ 系統架構分析設計
◦ 軟體框架分析設計
◦ 軟韌硬體整合開發
 基礎知識
 需求分析
 系統分析
 系統設計
 系統實作
 持續回饋
 在各個開發階段,提供指引與方針
系統分析 系統設計 系統實作
領域驅動設計
 透過分層設計,聚焦領域邏輯
Presentation AccessesDomain
APP Server Database
Presentation
Domain
Presentation
Domain
Presentation
Domain
Accesses Accesses Accesses
 Channel9課程連結:
◦ https://channel9.msdn.com/Series/three-tier-design
 點部落課程簡報:
◦ https://dotblogs.com.tw/clark/2016/03/14/075524
 基礎知識
 需求分析
 系統分析
 系統設計
 系統實作
 持續回饋
 軟體,是特定領域問題的解決方案
 找出需求背後的問題,提供解決方案
需求+問題 解決方案
 基礎知識
 需求分析
 系統分析
 系統設計
 系統實作
 持續回饋
 提供多元面向的解決方案
餐廳營運系統
Azure
門店點餐平板 門店營運伺服器
餐廳營運資料庫
座位RFID掃描器
門店帶位前台
 釐清解決方案的使用情景
座位狀態顯示客戶入座功能
客戶餐點查詢
Timer帶位人員
自動座位安排
 釐清解決方案的操作流程
京站門店帶位前台
桌號:01
座位:03/04
桌號:02
座位:00/04
桌號:04
座位:00/04
桌號:05
座位:04/04
桌號:03
座位:00/02
桌號:06
座位:02/02
桌號:05
小籠包x1
臭豆腐x2
蚵仔煎x6
使用中
空座位
自動座位安排
 釐清解決方案的功能需求
工作項目 項目說明 優先順序
座位狀態顯示 - 定時刷新目前座位狀態
- 座位狀態:入座數量、座位數量、入座狀態
- 入座狀態:空座位、使用中
高
客戶入座功能 - 確認客戶人數及座位後,即可安排客人入座 高
客戶餐點查詢 - 帶位人員可查詢目前入座客戶的餐點訂單 低
自動帶位功能 - 確認客戶人數後,系統自動計算座位安排
- 計算規則:入座空位最少、不提供併桌計算
中
…… …… ……
…… …… ……
 釐清解決方案的領域概念
門店帶位前台
門店
座位
顧客
餐點訂單
1
*
1
1
*
1
1
*
 基礎知識
 需求分析
 系統分析
 系統設計
 系統實作
 持續回饋
 統一領域模型的英文詞彙
中文名詞 英文名詞 備註
門店 Store
座位 Seat
顧客 Customer
餐點訂單 Meal Order
…… …… ……
…… …… ……
…… …… ……
 套用詞彙表將領域模型轉為領域物件
門店帶位前台
Store
Seat
Customer
MealOrder
1
*
1
1
*
1
1
*
 劃分進出系統邊界的物件顆粒
門店帶位前台
Store
Seat
Customer
MealOrder
1
*
1
1
*
1
1
*
 劃分進出系統邊界的物件顆粒
門店帶位前台
Store
Seat
Customer
MealOrder
1
*
1
1
*
1
+Id
+Id+Id
1
*
 建立Entity物件進出系統邊界的物件門戶
門店帶位前台
Store
Seat
Customer
MealOrder
1
*
1
1
*
1
+Id
+Id+Id
1
*
<<inteface>>
CustomerRepository
<<inteface>>
SeatRepository
<<inteface>>
StoreRepository
 建立Entity物件進出系統邊界的物件門戶
門店帶位前台
Store
Seat
Customer
MealOrder
1
*
1
1
*
1
+Id
+Id+Id
1
*
<<inteface>>
CustomerRepository
<<inteface>>
SeatRepository
<<inteface>>
StoreRepository
 定義Entity物件之間的關聯
門店帶位前台
Store
Seat
Customer
MealOrder
1
*
1
1
*
1
+Id
+Id
+MealOrderList
+Id
<<inteface>>
CustomerRepository
<<inteface>>
SeatRepository
<<inteface>>
StoreRepository
 定義Entity物件之間的關聯
門店帶位前台
Store
Seat
Customer
MealOrder
1
*
*
1
+Id
+CustomerId
+Id
+MealOrderList
+Id
<<inteface>>
CustomerRepository
<<inteface>>
SeatRepository
<<inteface>>
StoreRepository
 定義Entity物件之間的關聯
門店帶位前台
Store
Seat
Customer
MealOrder
+StoreId
+Id
+CustomerId
+StoreId
+Id
+MealOrderList
+Id
<<inteface>>
CustomerRepository
+GetAllByStoreId(storeId)
<<inteface>>
SeatRepository
+GetAllByStoreId(storeId)
<<inteface>>
StoreRepository
 散落畫面欄位到Entity
門店帶位前台
Store
Seat
Customer
MealOrder
+Name
+Count
<<inteface>>
CustomerRepository
+GetAllByStoreId(storeId)
<<inteface>>
SeatRepository
+GetAllByStoreId(storeId)
<<inteface>>
StoreRepository
+Id
+Name
+StoreId
+Id
+Name
+Count
+State
+CustomerId
+StoreId
+Id
+MealOrderList
+Count
 散落畫面功能到Entity、Repository
門店帶位前台
Store
Seat
Customer
MealOrder
+Name
+Count
<<inteface>>
CustomerRepository
+AddCustomer(customer)
+GetAllByStoreId(storeId)
<<inteface>>
SeatRepository
+SetSeat(seat)
+GetAllByStoreId(storeId)
<<inteface>>
StoreRepository
+GetCurrentStore()
+Id
+Name
+StoreId
+Id
+Name
+Count
+State
+CustomerId
+StoreId
+Id
+MealOrderList
+Count
 散落畫面功能到Service
門店帶位前台
Store
Seat
Customer
MealOrder
+Name
+Count
<<inteface>>
CustomerRepository
+AddCustomer(customer)
+GetAllByStoreId(storeId)
<<inteface>>
SeatRepository
+SetSeat(seat)
+GetAllByStoreId(storeId)
<<inteface>>
StoreRepository
+GetCurrentStore()
+Id
+Name
+StoreId
+Id
+Name
+Count
+State
+CustomerId
+StoreId
+Id
+MealOrderList
+Count
SmartUsherService
+Usher(customer)
 描述功能職責,所進行的物件交互
門店帶位前台 - 自動帶位功能
SmartUsherService SeatRepository CustomerRepository
Usher(customer)
GetAllByStoreId(storeId)
return seatList
Distribute(customer, seatList)
SetSeat(seat)
AddCustomer(customer)
return seat
 基礎知識
 需求分析
 系統分析
 系統設計
 系統實作
 持續回饋
 套用Facade模式,簡化操作使用
門店帶位前台
<<inteface>>
CustomerRepository
+AddCustomer(customer)
+GetAllByStoreId(storeId)
<<inteface>>
SeatRepository
+SetSeat(seat)
+GetAllByStoreId(storeId)
<<inteface>>
StoreRepository
+GetCurrentStore()
SmartUsherService
+Usher(customer)
UsherContext
+StoreRepository
+SeatRepository
+CustomerRepository
+SmartUsherService
 選用DI Framework,填充Context內容
門店帶位前台
<<inteface>>
CustomerRepository
+AddCustomer(customer)
+GetAllByStoreId(storeId)
<<inteface>>
SeatRepository
+SetSeat(seat)
+GetAllByStoreId(storeId)
<<inteface>>
StoreRepository
+GetCurrentStore()
SmartUsherService
+Usher(customer)
UsherContext
+StoreRepository
+SeatRepository
+CustomerRepository
+SmartUsherService
DI Framework
SQL
StoreRepository
SQL
SeatRepository
SQL
CustomerRepository
<<create>> <<create>> <<create>>
<<create>>
DI Framework
 基礎知識
 需求分析
 系統分析
 系統設計
 系統實作
 持續回饋
 持續回饋問題,完整封裝領域知識
問題反饋
領域模型領域知識 領域物件
領域驅動設計
K.NET講師 Clark

領域驅動設計