Taiwan DDD Community
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # DDD 中的橋樑:透過有效建模與設計,從戰略走向戰術 講師: James Wang --- 分享目的: 提供一個實踐經驗提供給大家參考與討論 面對陌生的環境,先對周邊探索繪製手繪地圖, 隨著探索發現地圖也會更新與修正, 地圖成為航海家們的共通語言, 促進團隊間協作的橋樑, 透過建模的過程, 釐清問題的本質 ## 模型: 連接問題空間 與 解決空間的橋樑 地圖是一個模型的表示, 模型表示了解決真實問題的解決方法的具體表示 將問題空間中的訊息需求轉化成策略和實踐 模型為了貼切解決問題, 需要持續的迭代來精鍊 ## 從需求到實現:一個全面的探索過程 首先識別出具有商業價值的流程, 作為起點 透過繪製限界上下文地圖,將這些流程化分成不同的範疇, 並梳理這些範疇之間的關係 再進來進到每個範疇內, 進行細部討論與設計 ## 戰略設計的產出 : Bounded Context 透過Event Storming的設計討論, 看見全貌後, 進而識別出Bounded context. 與特定領域有關系的系統 ### 用業務流程串接 Bounded Contexts ### 動態與靜態 : 業務流程與 Context Map的結合 這裡能定義出職責 還能識別出"資訊"是如何在這些Bounded Contexts流轉的 PNR : Partner Ship(夥伴關係) CF : 遵奉者模式, 需要follow上游的系統的規範來設計 OHS : Open/Host Service 更能全面的理解與設計系統,使其業務更具彈性 ### Context Map Cheat Sheet ![](https://hackmd.io/_uploads/BJ1n6zNkp.png) CF模式的合作下, 下游系統可能會需要設計出ACL防腐層, 防止因為上游的異動, 而影響到下游也需要跟著異動 電商與物流互動,服務之間是客戶與供應商模式,需要有清晰的界限和責任確保不會互相干擾,但還需要考慮流量、系統穩定性 ## 服務間溝通:同步與非同步的選擇與影響 ![](https://hackmd.io/_uploads/rJERaGVyT.png) 挑選出特定的服務流程, 來繪製出context map, 並且能討論出, 各服務(各bounded contexts)間的資料溝通是需要同步還是非同步, 才適合挑選出適當的技術選型 ![](https://hackmd.io/_uploads/HyEwCMV1p.png) 將剛剛討論好特定流程的context map, 進而討論出更多資料模型(read model, data, api, pub/sub events, ui, user stories...) 也順便達成共識 例如使用者用手機下訂單,可以由業務流程拆解紀錄,譬如可以記錄風險,在訂單延遲了可以通知使用者 ## 在進入設計階段之前:混沌探索業務規則 ![](https://hackmd.io/_uploads/BkoM1X4JT.png) 在條列出領域事件後 將業務規則條列出來 ![](https://hackmd.io/_uploads/rJWL1XEy6.png) ## 將業務規則分組 ![](https://hackmd.io/_uploads/S1sAk74kp.png) 我們要做的是捕捉領域專家的觀點,融入到設計與程式碼中 ## 每群業務規則可視為聚合候選項 ![](https://hackmd.io/_uploads/SyV6y7Ey6.png) ![](https://hackmd.io/_uploads/ry4rxXNJa.png) 探索中的業務規則, 能夠精鍊成測試案例 ## 驗證指標(Verification Metrics) ![](https://hackmd.io/_uploads/ryGDlQ41a.png) 指標能夠幫助我們在營運時, 能指出是否需要調整策略, 進而滿足業務需求 ## 非功能性需求 ![](https://hackmd.io/_uploads/ry-ngXN1p.png) 非功能性需求將影響運營中的系統有可靠性或更多關於成本或安全性的影響 * 安全性 * 效能 * 流量 * 併發 * 可用性 * 可維護性 * 可觀測性 * 容錯 ## 架構設計 ![](https://hackmd.io/_uploads/SyblZm4yp.png) 不只水平切分 能夠過boundex context進行垂直切分 ## 總結 DDD 是**劃分邊界**的藝術 有了全貌, 有了各顆粒的邊界, 就能切分出各階段,並且組裝起來滿足真實世界問題的所需. 每個環節階段都能夠反映到領域知識,自由的 Zoom in/out 看到我們想看到的東西 ## Q&A ![](https://hackmd.io/_uploads/H1U0bmEJ6.png) A1 : 往下探討Aggregate的部份 A2 : 可以找業務單位, 客服單位; 或者從用戶在操作系統的角度, 搭配程式碼來反推 ![](https://hackmd.io/_uploads/rJdnz7VJp.png) A1 : 要有足夠的**戰略設計的產出**, 團隊內部自己就能去主導戰術的規劃 ![](https://hackmd.io/_uploads/BkXOQXN1p.png) A1 : 從物件的一連串狀態移轉, 來探索聚合根以及內部的聚合 A2 : 關注於當下即可, 除非已經知道未來業務流程或擴充上會如何變化了; 重點還是再有自動化測試, 在未來變化時, 才能過保過往的品質 ![](https://hackmd.io/_uploads/HkDRQXV1T.png) A1 : yes A2 : 分而自治, 才好估算出各個小元件的時程 A3 :

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully