iT邦幫忙

1

高內聚與低耦合

  • 分享至 

  • twitterImage
  •  

Software Architecture
從軟體的角度來看:

  • 內聚力(cohesion)是指模組(module)中元素的相關(relatedness)程度。 “高內聚力”是指模組內的組成元素都高度相關。物件導向程式開發中,類別(class)是最常見的模組化結之一。
  • 耦合性(coupling)是指模組與模組之間的依賴(dependency)程度。依賴程度是指模組與模組間的關係與互動。“低耦合”意味著一個模組對其他模組的依賴(dependency)得到了很好的管理(well-managed)。介面(interface)與抽象類別(abstract class)是支持設計模式-依賴項注入(dependency injection)的常見構造。
  • 模組是模組化(modularization)和封裝(encapsulation)的結果,它將相關元素放在一起並隱藏了資訊和邏輯。

原始出處: High Cohesion and Low Coupling


圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言