principles:don_t_repeat_yourself
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:don_t_repeat_yourself [2012-11-27 09:18] – [Origin] link christian | principles:don_t_repeat_yourself [2021-09-02 11:47] – old revision restored (2021-05-19 10:22) 65.21.179.175 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Don't Repeat Yourself (DRY) ====== | ====== Don't Repeat Yourself (DRY) ====== | ||
- | ===== Alternative Names ===== | + | ===== Variants and Alternative Names ===== |
* Single Point of Truth (SPOT) | * Single Point of Truth (SPOT) | ||
Line 8: | Line 8: | ||
===== Context ===== | ===== Context ===== | ||
- | * [[contexts:Software | + | * [[contexts:Object-Oriented |
- | + | ===== Principle Statement | |
- | ===== Description | + | |
> "Every piece of knowledge must have a single, unambiguous, | > "Every piece of knowledge must have a single, unambiguous, | ||
+ | |||
+ | |||
+ | ===== Description ===== | ||
DRY not only states that code duplication shall be avoided. Rather DRY is a general rule that states that if there is duplication, | DRY not only states that code duplication shall be avoided. Rather DRY is a general rule that states that if there is duplication, | ||
Line 21: | Line 23: | ||
If there are several representations of the same information (be it code or any other form of information), | If there are several representations of the same information (be it code or any other form of information), | ||
+ | |||
+ | |||
+ | ===== Strategies ===== | ||
Line 29: | Line 34: | ||
===== Evidence ===== | ===== Evidence ===== | ||
+ | /* Comment out what is not applicable and explain the rest: */ | ||
+ | /* * [[wiki: | ||
+ | /* * [[wiki: | ||
- | Widely accepted: It is generally agreed upon that code duplication is to be avoided. On the other hand the broader meaning of DRY which results in the heavy use of code generators is often not considered. | + | * [[wiki: |
+ | |||
+ | /* * [[wiki: | ||
===== Relations to Other Principles ===== | ===== Relations to Other Principles ===== | ||
- | ==== Specialization of ==== | + | ==== Generalizations |
- | * [[principles: | ||
- | ==== Generalization of ==== | + | ==== Specializations |
- | ==== Contrary | + | * [[principles: |
+ | * [[principles: | ||
+ | * [[principles: | ||
+ | * [[principles: | ||
+ | |||
+ | ==== Contrary | ||
* [[principles: | * [[principles: | ||
- | ==== Complementary | + | ==== Complementary |
- | ==== Part of the Following Principle Collections ==== | ||
+ | ==== Principle Collections ==== | ||
+ | |||
+ | {{page> | ||
+ | {{page> | ||
===== Example ===== | ===== Example ===== | ||
Line 54: | Line 71: | ||
===== Description Status ===== | ===== Description Status ===== | ||
+ | /* Choose one of the following and comment out the rest: */ | ||
+ | [[wiki: | ||
+ | / | ||
+ | / | ||
+ | |||
+ | |||
+ | ===== Further Reading ===== | ||
- | Stub | + | * [[wiki> |
+ | * [[wp> | ||
+ | * [[http:// | ||
principles/don_t_repeat_yourself.txt · Last modified: 2021-10-18 21:27 by christian