Single choice principle
From CSSEMediaWiki
(Difference between revisions)
m (Reverted edits by Ebybymic (Talk); changed back to last version by Scott Parlane) |
|||
Line 1: | Line 1: | ||
This states that whenever a program needs to support a set of known alternatives, this set should only exist in one module. Repeating the alternatives in several modules is unnecessary and makes it hard to maintain when an alternative is added or removed. | This states that whenever a program needs to support a set of known alternatives, this set should only exist in one module. Repeating the alternatives in several modules is unnecessary and makes it hard to maintain when an alternative is added or removed. | ||
− | + | == See also == | |
* [[Design maxims]] | * [[Design maxims]] | ||
* [[Once and only once]] | * [[Once and only once]] | ||
Line 10: | Line 10: | ||
* [[Strategy]] | * [[Strategy]] | ||
* [[Switch statement smell]] (Espically, the same switch statement in many places) | * [[Switch statement smell]] (Espically, the same switch statement in many places) | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 03:23, 25 November 2010
This states that whenever a program needs to support a set of known alternatives, this set should only exist in one module. Repeating the alternatives in several modules is unnecessary and makes it hard to maintain when an alternative is added or removed.
See also
- Design maxims
- Once and only once
- Duplicate code smell
- Don't repeat yourself
- Code smells
- Refactoring
- Strategy
- Switch statement smell (Espically, the same switch statement in many places)