principles:single_responsibility_principle
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
principles:single_responsibility_principle [2021-09-02 12:26] – old revision restored (2021-05-19 11:18) 65.21.179.175 | principles:single_responsibility_principle [2021-09-02 12:27] – old revision restored (2021-05-19 11:17) 65.21.179.175 | ||
---|---|---|---|
Line 5: | Line 5: | ||
* One Responsibility Rule | * One Responsibility Rule | ||
* Separation of Concerns (this originally was a broader term but is mostly used just like SRP) | * Separation of Concerns (this originally was a broader term but is mostly used just like SRP) | ||
- | * Curly' | ||
- | * Do One Thing | ||
===== Context ===== | ===== Context ===== | ||
/* fill in contexts here: */ | /* fill in contexts here: */ | ||
- | * [[contexts:Object-Oriented Design]] | + | * [[contexts:Software |
- | * [[contexts: | + | |
- | * [[contexts: | + | |
- | * [[contexts: | + | |
- | ===== Principle Statement ===== | ||
- | There should never be more than one reason | + | ===== Definition ===== |
+ | |||
+ | There should never be more than one reason | ||
Line 31: | Line 27: | ||
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]]. | ||
===== Origin ===== | ===== Origin ===== | ||
/* the *primary* source */ | /* the *primary* source */ | ||
- | {{page> | + | |
===== Evidence ===== | ===== Evidence ===== | ||
/* Comment out what is not applicable and explain the rest: */ | /* Comment out what is not applicable and explain the rest: */ | ||
- | /* | + | / |
- | /* | + | / |
- | + | [[wiki: | |
- | * [[wiki: | + | / |
- | + | ||
- | /* | + | |
Line 59: | Line 45: | ||
==== Generalizations ==== | ==== Generalizations ==== | ||
- | * [[High Cohesion]] | + | * [[principle:High Cohesion]] |
- | * [[Encapsulate the Concept that Varies]] (ECV) | + | |
==== Specializations ==== | ==== Specializations ==== | ||
Line 67: | Line 53: | ||
==== Complementary Principles ==== | ==== Complementary Principles ==== | ||
+ | * [[principles: | ||
==== Principle Collections ==== | ==== Principle Collections ==== | ||
- | {{page> | + | |
- | ===== Examples | + | ===== Example |
===== Description Status ===== | ===== Description Status ===== | ||
/* Choose one of the following and comment out the rest: */ | /* Choose one of the following and comment out the rest: */ | ||
- | /*[[wiki: | + | [[wiki: |
- | [[wiki: | + | /*[[wiki: |
/ | / | ||
===== Further Reading ===== | ===== Further Reading ===== | ||
- | * {{page> | + | * Robert C. Martin: //Agile Software Development, |
* [[http:// | * [[http:// | ||
* [[wiki> | * [[wiki> | ||
Line 89: | Line 76: | ||
* [[wp> | * [[wp> | ||
* [[http:// | * [[http:// | ||
- | * Coding Horror: [[http:// | ||
- | |||
- | ===== Discussion ===== | ||
- | |||
- | Discuss this wiki article and the principle on the corresponding [[talk: |
principles/single_responsibility_principle.txt · Last modified: 2021-10-18 22:01 by christian