Try   HackMD

2022 年 08 月 - DDD 是什麼?

Service Object 是 DDD 的一種
clean architecture

ruby -> open class

Ruby on Rails 怎麼用

DHH say
https://en.wikipedia.org/wiki/Data,_context_and_interaction

戰略: 怎麼劃分 domain
戰術: 實作
領域專家 -> 共同語言

沒有領域專家導入 DDD 會失敗,因為要先知道真正在用的人要怎麼用

DDD 分四層
clean architecture 三層 -> 往上疊變 DDD

  • 用戶介面層 (User Interface) Presentation Layer
    • input, output, ex: rails view
  • 應用層 (Application Layer)
    • user flow
  • 領域層 (Domain Layer)
    • business logic
  • 基礎設施層 (Infrastructure Layer)
    • 打 api, 拉資料, 通知

出處:https://devs.tw/post/380

logic(邏輯) 和 flow(流程)

  • flow 裡面不會有 logic
  • flow 不能有任何 if else 的東西

Entity 一定有 id,看相不相同
Value Object 不能修改,比較所有數值
repository
event broadcast
Aggregate root

參考: https://hackmd.io/@ballfish/DDD#Entity-Reference-Object