coupling
いろいろな意味が あるが、ここでは特に software におけるモノに着目する。
他の意味
カップリング
継手
連結器
software design
ja: 結合
結合性: 疎密
table:強さ
疎結合 Loose Coupling
密結合 Tight Coupling
低凝集 Low Cohesion
高凝集 High Cohesion
下流の利用者が上流に依存して結合してる とき、上流からは下流に知識が流れてる。
公開して共有する知識が少ない ほど 変更の連鎖的な波及を減らせる。
3次元ある
強度 ≈ 種類
空間 = 距離
時間 = 変動性、変更頻度
interface
aka. protocol, contract
物理的に つながって なくても、知識に依存してて 同時に変更 せざるを得ない 結合が あり得る。
integration strength
ja: 統合強度
by Khononov
interfaceに ついて 語る
モジュール結合とコナーセンスの概念を統合する。
module coupling
connascence
4 levels:
intrusive coupling
境界を侵犯して侵入してる。
functional coupling
共有された ふるまい など
知識が単方向でなく双方向に流れて しまってる。
degrees
sequential functional coupling
transactional functional coupling
symmetric functional coupling
= duplicated functionality
= duplicated knowledge
model coupling
大雑把なインターフェイス。
結局、実装モデルが そのまま露出して しまってる。
余計な共有知識がある。
contract coupling
統制されたインターフェイス。専用モデル(統合モデル)。
コナーセンスも一様に低い。 (sup CC < inf MC)
余計な共有知識がない。
integration contract: public interface
内部や実装のmodelよりも安定してる。
versioning is available
degree
共有される知識の複雑さ の度合い
距離
種類: 物理的、組織的つまり所有権、相互作用
遠いほど高コスト
遠いほどライフサイクル結合が低い(逆比例)。
実行時結合: 同期統合なら近く、非同期統合なら遠い。
cf. proximity
変動性
= 変更頻度
解法 and/or 問題が 変化する。
2軸4象限
高変動性 0,1 × 高強度 0,1
安定性 = 低変動性 ∨ 低強度 = 高変動性 ⊼ 高強度
変更コスト = 高変動性 ∧ 高強度
モジュール性 = 高強度 ⊻ 遠距離
= 高強度 ≠ 遠距離
= { 高凝集, 疎結合 }
高凝集と疎結合は排反
高凝集 = 遠距離 ↛ 高強度
疎結合 = 遠距離 ↚ 高強度
複雑性 = ¬ modularity = 変動性 ↔ 距離
大域的複雑性 = 高変動 ∧ 遠距離
局所的複雑性 = 高変動 ⊽ 遠距離
= 低変動 ∧ 近距離
均衡度 = 高変動 → 高モジュール性
= 高モジュール性 ← 高変動
= no modularity even if high variability
https://www.wolframalpha.com/input?i=R+implies+P+xor+Q
均衡度が高い結合を均衡結合と呼ぶ。
wint.icon ここで作られたブール代数風味の代数構造は complemented distributive lattice とでも呼べるだろう。
complemented ⇒ bounded
短く言って complemented chain
ref.
Khononov. (2024). Balancing Coupling in Software Design: Universal Design Principles for Architecting Modular Software Systems.
Balancing Coupling in Software Design
Balancing Coupling in Software Design (KanDDDinsky 2022) - Speaker Deck
https://www.oreilly.com/library/view/balancing-coupling-in/9780137353514/
https://www.google.co.jp/books/edition/Balancing_Coupling_in_Software_Design/t6vUEAAAQBAJ
翻訳
https://book.impress.co.jp/books/1124101149
#software