Single choice principle
From CSSEMediaWiki
(Difference between revisions)
m (Reverted edits by Ebybymic (Talk); changed back to last version by Scott Parlane) |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 9: | Line 9: | ||
* [[Refactoring]] | * [[Refactoring]] | ||
* [[Strategy]] | * [[Strategy]] | ||
+ | * [[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)