principles:rule_of_explicitness
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| principles:rule_of_explicitness [2021-09-02 12:38] – old revision restored (2021-05-11 22:22) 65.21.179.175 | principles:rule_of_explicitness [2021-10-18 22:06] (current) – +++ restored +++ christian | ||
|---|---|---|---|
| Line 9: | Line 9: | ||
| * [[contexts: | * [[contexts: | ||
| * [[contexts: | * [[contexts: | ||
| + | * [[contexts: | ||
| ===== Principle Statement ===== | ===== Principle Statement ===== | ||
| Line 18: | Line 18: | ||
| ===== Description ===== | ===== Description ===== | ||
| + | Solutions often differ in the level of explicitness. A feature can be implemented explicitly or it can be a side-effect of the implementation of another feature or a more general functionality. The same applies to module communication. A module can invoke another module directly or there can be various forms of indirections like events or observers. | ||
| + | RoE states that explicit solutions are better than implicit ones. Indirection, | ||
| ===== Rationale ===== | ===== Rationale ===== | ||
| + | If something is realized explicitly, it is easier to understand. Implicit solutions require the developer to have a deeper understanding of the module as it is necessary to "read between the lines" | ||
| ===== Strategies ===== | ===== Strategies ===== | ||
| Line 31: | Line 34: | ||
| * Avoid highly configurable modules. Instead implement varying behavior explicitly. | * Avoid highly configurable modules. Instead implement varying behavior explicitly. | ||
| * Explicitly state which module to use | * Explicitly state which module to use | ||
| - | * Avoid importing all classes of a given package/ | + | * Avoid importing all classes of a given package/ |
| * Avoid '' | * Avoid '' | ||
| * Explicitly name parameters | * Explicitly name parameters | ||
| Line 81: | Line 84: | ||
| * [[Generalization Principle]] (GP): RoE often results in specific solutions. Generality often requires stating something implicitly. | * [[Generalization Principle]] (GP): RoE often results in specific solutions. Generality often requires stating something implicitly. | ||
| * [[Low Coupling]] (LC): Direct communication typically has the disadvantage of a higher coupling. Indirection reduces coupling but creates implicit/ | * [[Low Coupling]] (LC): Direct communication typically has the disadvantage of a higher coupling. Indirection reduces coupling but creates implicit/ | ||
| - | + | * [[Don' | |
| ==== Complementary Principles ==== | ==== Complementary Principles ==== | ||
| * [[Keep It Simple Stupid]] (KISS): Explicit solutions are often also simpler. | * [[Keep It Simple Stupid]] (KISS): Explicit solutions are often also simpler. | ||
| - | * [[Murphy' | + | * [[Murphy' |
| * [[Model Principle]] (MP): RoE states that [[anti-patterns: | * [[Model Principle]] (MP): RoE states that [[anti-patterns: | ||
| + | * [[Law of Leaky Abstractions]] (LLA): Often abstractions create a level of implicitness. Abstraction leaks are one reason why explicit solutions can be considered preferable. | ||
| ==== Principle Collections ==== | ==== Principle Collections ==== | ||
| Line 100: | Line 102: | ||
| ===== 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 109: | Line 111: | ||
| * Martin Fowler: // | * Martin Fowler: // | ||
| * Tim Peters: // | * Tim Peters: // | ||
| + | |||
| + | ===== Discussion ===== | ||
| + | |||
| + | Discuss this wiki article and the principle on the corresponding [[talk: | ||
principles/rule_of_explicitness.1630579113.txt.gz · Last modified: by 65.21.179.175
