principles:generalization_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:generalization_principle [2013-02-10 18:33] – relations christian | principles:generalization_principle [2020-10-12 14:20] – old revision restored (2013-06-22 20:35) 159.69.186.191 | ||
---|---|---|---|
Line 3: | Line 3: | ||
===== Variants and Alternative Names ===== | ===== Variants and Alternative Names ===== | ||
- | * Build Generality into Software | + | * Build Generality into Software(({{page> |
+ | * Abstractions Live Longer than Details(({{page> | ||
===== Context ===== | ===== Context ===== | ||
* [[contexts: | * [[contexts: | ||
+ | * [[contexts: | ||
+ | * [[contexts: | ||
+ | * [[contexts: | ||
===== Principle Statement ===== | ===== Principle Statement ===== | ||
Line 21: | Line 24: | ||
A general solution abstracts from the specific tasks and solves a superset of them. Parameterization of some kind is used to specify what has to be done in a given situation. | A general solution abstracts from the specific tasks and solves a superset of them. Parameterization of some kind is used to specify what has to be done in a given situation. | ||
+ | A module can be more general than another one. But there are two aspects of this: First of all there is functionality. If module '' | ||
===== Rationale ===== | ===== Rationale ===== | ||
Line 30: | Line 33: | ||
===== Strategies ===== | ===== Strategies ===== | ||
+ | * Make modules configurable at runtime or deployment time by using configuration files. | ||
+ | * Use parameterizable modules(method parameters, object attributes, parametric types, etc.) | ||
+ | * Use constants | ||
+ | * Find suitable abstractions | ||
+ | |||
+ | ===== Caveats ===== | ||
+ | |||
+ | Making a [[glossary: | ||
+ | |||
+ | Another problem is the [[anti-patterns: | ||
+ | |||
+ | See also section [[#contrary principles]]. | ||
===== Origin ===== | ===== Origin ===== | ||
- | FIXME | + | The term " |
+ | |||
+ | {{page> | ||
===== Evidence ===== | ===== Evidence ===== | ||
Line 55: | Line 73: | ||
* **[[Keep It Simple Stupid]] (KISS)**: A generalized solution is typically not simple anymore. This is the typical conflict between generality and simplicity. | * **[[Keep It Simple Stupid]] (KISS)**: A generalized solution is typically not simple anymore. This is the typical conflict between generality and simplicity. | ||
+ | * [[Easy to Use and Hard to Misuse]] (EUHM): Too general solutions may lead to complicated usage of the module. | ||
+ | * [[Rule of Explicitness]] (RoE): RoE often results in specific solutions. Generality often requires stating something implicitly. | ||
==== Complementary Principles ==== | ==== Complementary Principles ==== | ||
Line 66: | Line 85: | ||
{{page> | {{page> | ||
- | ===== Example | + | ===== Examples |
===== 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: |
/ | / | ||
Line 78: | Line 97: | ||
===== Further Reading ===== | ===== Further Reading ===== | ||
- | * | ||
+ | |||
+ | ===== Discussion ===== | ||
+ | |||
+ | Discuss this wiki article and the principle on the corresponding [[talk: |
principles/generalization_principle.txt · Last modified: 2021-10-20 21:20 by christian