Day 22: 元件原则 — 内聚性 (待改进中... )

「如果 SOLID 原则告诉我们的是如何将砖块安排到墙壁和房间中,那麽元件原则就是告诉我们,如何将房间安排到建筑物之中」

取自: Clean Architecture (p.79)

CH12: 元件 (Component)

发展 50 年的成果...

元件简史

  • Linker
  • Loader
  • Plugin

[补充]: 元件原则/打包原则 (Component Principles/Package Principles)

关於....

  • 内聚性 (Cohesion)
    • The Reuse/Release Equivalence Principle (REP)

      ...

    • The Common Reuse Principle (CRP)

      ...

    • The Common Closure Principle (CCP)

      ...

  • 耦合性 (Coupling)
    • The Acyclic Dependencies Principle (ADP)

      ...

    • The Stable-Dependency Principle (SDP)

      ...

    • The Stable-Abstractions Principle (SAP)

      ...


CH13: 元件内聚性 (Component Cohesion)

「我们曾经认为内聚性就是『一个模组只能执行一个功能』如此的属性罢了。然而,在选择类别(Class)组合成元件时,必须考虑到涉及可重用性可发展性的相对力量」

取自: Clean Architecture (p.94)

元件内聚性的张力图 (The Triad of Component Principles)

一般来说...
选择 & 取舍...


Reuse / Release Equivalence Principle (REP)

「」

原文: "The granule of reuse is the granule of release"

取自:

...


Common Closure Principle (CCP)

「」

原文: "The classes in a package are reused together. If you reuse one of the classes in a package, you reuse them all"

取自:

...


Common Reuse Principle (CRP)

「」

原文: "The classes in a package should be closed together against the same kinds of changes. A change that affects a package affects all the classes in that package and no other packages"

取自:

...


Reference

元件内聚性 Component Cohesion
细谈元件内聚性
Clean Architecture - Examples for "The Triad of Component Principles"
Clean Architecture -> PART IV: Component Principles
4.1. Principles of Package Design
Package principles


<<:  Day 22 :Validate BST

>>:  EP 29: Archive and Publish TopStore App for Android in Visual Studio

Day14 - 结果今天只做小蛇,小蛇还不贪

class Snake { constructor() { // 蛇头位子 this.head = ...

页面切换好夥伴- Vue Router [序]

前言 在过去,路由主要是 Server 负责,根据不同的路由去决定要渲染的页面,回传整个 HTML ...

Grid笔记

假使设定HTML: <div class="container"> ...

业务连续性委员会(Business Continuity Committee)

-董事委员会 董事会认为必要时可设立任何委员会。有些委员会通常是法律或法规所要求的,例如审计委员会...

Day17 - [丰收款] 永丰API虚拟帐户付款与PayToken查询与更新状态

在经过了多日有一天没一天的研究、写Code与写作,今天假日花了一点时间将原本从Jupyter Not...