User Tools

Site Tools


principles:high_cohesion

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
principles:high_cohesion [2013-02-18 17:24] – external edit 127.0.0.1principles:high_cohesion [2021-09-02 12:37] – old revision restored (2021-05-11 21:54) 65.21.179.175
Line 6: Line 6:
 ===== Context ===== ===== Context =====
 /* fill in contexts here: */ /* fill in contexts here: */
-  * [[contexts:Object-Oriented Design]] +  * [[contexts:Object-Oriented Design]] 
 +  * [[contexts:API Design]] 
 +  * [[contexts:Architecture]]
  
  
Line 40: Line 42:
  
   * [[wiki:Examined]]   * [[wiki:Examined]]
-  * [[wiki:Accepted]]+  * [[wiki:Accepted]] The concept of high cohesion is widely known and described in several well-known books for example in Craig Larman's //Applying UML and Patterns//
  
 /*[[wiki:Questioned]]*/ /*[[wiki:Questioned]]*/
Line 51: Line 53:
 ==== Specializations ==== ==== Specializations ====
  
-  * [[Tell don't Ask/Information Expert]] (TdA/IE): Adhering to information expert means that a module only has responsibilities which belong together. So this increases cohesion. 
   * [[Constantine's Law]]: Constantine's Law is just the combination of HC and LC.   * [[Constantine's Law]]: Constantine's Law is just the combination of HC and LC.
   * [[Single Responsibility Principle]] (SRP): SRP is a stronger version of HC.   * [[Single Responsibility Principle]] (SRP): SRP is a stronger version of HC.
Line 65: Line 66:
 ==== Complementary Principles ==== ==== Complementary Principles ====
  
 +  * [[Tell don't Ask/Information Expert]] (TdA/IE): IE may help finding solutions with high cohesion. On the other hand it may also be disadvantageous in some cases (see [[Tell don't Ask/Information Expert#caveats]]). 
   * [[Encapsulate the Concept that Varies]] (ECV): Adhering to HC often results in modules to be split up into several more cohesive ones. ECV gives further advice on how to do that.   * [[Encapsulate the Concept that Varies]] (ECV): Adhering to HC often results in modules to be split up into several more cohesive ones. ECV gives further advice on how to do that.
  
Line 73: Line 75:
  
  
-===== Example =====+===== Examples =====
  
  
Line 87: Line 89:
   * [[wp>Cohesion (computer science)]]   * [[wp>Cohesion (computer science)]]
   * [[wiki>CouplingAndCohesion]]   * [[wiki>CouplingAndCohesion]]
 +  * Craig Larman: //Applying UML and Patterns – An Introduction to Object-Oriented Analysis and Design and Iterative Development//
  
 +===== Discussion =====
 +
 +Discuss this wiki article and the principle on the corresponding [[talk:principles:High Cohesion|talk page]].
principles/high_cohesion.txt · Last modified: 2021-10-18 21:36 by christian