User Tools

Site Tools


principles:single_responsibility_principle

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:single_responsibility_principle [2020-10-12 16:37] – old revision restored (2012-11-29 17:16) 159.69.186.191principles:single_responsibility_principle [2021-09-02 12:27] – old revision restored (2021-05-11 22:28) 65.21.179.175
Line 9: Line 9:
 ===== Context ===== ===== Context =====
 /* fill in contexts here: */ /* fill in contexts here: */
-  * [[contexts:Software Design]] +  * [[contexts:Object-Oriented Design]] 
 +  * [[contexts:API Design]] 
 +  * [[contexts:Architecture]] 
 +  * [[contexts:User Interface Design]]
  
- +===== Principle Statement =====
-===== Definition =====+
  
 There should never be more than one reason for a [[glossary:module]] to change.((compare [[http://www.objectmentor.com/resources/articles/srp.pdf|Robert C. Martin: Single Responsibility Principle]])) There should never be more than one reason for a [[glossary:module]] to change.((compare [[http://www.objectmentor.com/resources/articles/srp.pdf|Robert C. Martin: Single Responsibility Principle]]))
Line 27: Line 29:
  
 When this rule is not adhered to, one module has several tasks. If one of these tasks changes, there is the risk that this also has an effect on the other task that normally should be independent. Thus unrelated functionality may break. When this rule is not adhered to, one module has several tasks. If one of these tasks changes, there is the risk that this also has an effect on the other task that normally should be independent. Thus unrelated functionality may break.
 +
 +
 +===== Strategies =====
 +
 +
 +===== Caveats =====
 +
 +See section [[#contrary principles]].
  
  
Line 35: Line 45:
 ===== Evidence ===== ===== Evidence =====
 /* Comment out what is not applicable and explain the rest: */ /* Comment out what is not applicable and explain the rest: */
-/*[[wiki:Proposed]]*/ +/*  * [[wiki:Proposed]]*/ 
-/*[[wiki:Examined]]*/ +/*  * [[wiki:Examined]]*/ 
-[[wiki:Accepted]] + 
-/*[[wiki:Questioned]]*/+  * [[wiki:Accepted]] 
 + 
 +/*  * [[wiki:Questioned]]*/
  
  
Line 45: Line 57:
 ==== Generalizations ==== ==== Generalizations ====
  
-  * [[principle:High Cohesion]] +  * [[High Cohesion]] (HC) 
 +  * [[Encapsulate the Concept that Varies]] (ECV)
 ==== Specializations ==== ==== Specializations ====
  
Line 53: Line 65:
 ==== Complementary Principles ==== ==== Complementary Principles ====
  
-  * [[principles:Principle of Locality]] 
  
 ==== Principle Collections ==== ==== Principle Collections ====
  
-  * [[collections:SOLID]] +{{page>collections:SOLID#Box}} 
-  * [[collections:Robert C. Martin's Principle Collection]] +===== Examples =====
-===== Example =====+
  
  
Line 77: Line 87:
   * [[wp>Separation of Concerns]]   * [[wp>Separation of Concerns]]
   * [[http://blog.8thlight.com/cory-foy/2012/08/07/thinking-differently-about-srp.html|Thinking Differently About the Single Responsibility Principle]]   * [[http://blog.8thlight.com/cory-foy/2012/08/07/thinking-differently-about-srp.html|Thinking Differently About the Single Responsibility Principle]]
 +
principles/single_responsibility_principle.txt · Last modified: 2021-10-18 22:01 by christian