跳到主要内容

架構模式 Patterns

跨專案重用的架構 pattern 庫。

狀態:預留中(2026-05)

預留給累積 ≥ 2 個專案實作過同一 pattern 後 promote 上來。

收錄什麼(未來)

  • 跨專案重用的架構模式(含 Context / Forces / Solution / Examples)
  • 範例:
    • PC + PLC 雙層架構(待 Beckhoff 整合後 promote)
    • 雙 HMI 架構(製程畫面 + 維修人機)
    • Mode 管理 + Recovery Sequence
    • Auto/Manual FB 雙介面
    • Stateless State Machine 模板(已有 framework/core/stateless-*,重複內容不放這裡)

不收錄什麼

  • 單一專案的實作細節 → 該專案 repo
  • Library 使用 Pattern → framework/{subgroup}/
  • 一次性的決策 → architecture/adr/

Pattern 文件格式

# Pattern Name

## Context
(什麼情況用這個 pattern)

## Forces
(衝突的需求 / trade-off)

## Solution
(解法描述 + 圖)

## Examples
(≥ 2 個專案的實作引用)

## Trade-offs
(什麼時候 NOT 用)

Promote 規則

  • 至少 2 個專案實作過 → 才 promote 為 pattern
  • 一個 pattern 一檔
  • 包含 ≥ 2 個 production examples