principles:law_of_demeter
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
principles:law_of_demeter [2012-12-18 12:01] – created christian | principles:law_of_demeter [2021-10-18 21:52] (current) – +++ restored +++ christian | ||
---|---|---|---|
Line 9: | Line 9: | ||
/* fill in contexts here: */ | /* fill in contexts here: */ | ||
* [[contexts: | * [[contexts: | ||
+ | * [[contexts: | ||
===== Principle Statement ===== | ===== Principle Statement ===== | ||
Line 27: | Line 27: | ||
===== Strategies ===== | ===== Strategies ===== | ||
+ | |||
+ | |||
+ | ===== Caveats ===== | ||
+ | |||
+ | See section [[#contrary principles]]. | ||
Line 34: | Line 39: | ||
===== Evidence ===== | ===== Evidence ===== | ||
/* Comment out what is not applicable and explain the rest: */ | /* Comment out what is not applicable and explain the rest: */ | ||
- | / | + | /* |
- | [[wiki: | + | |
- | [[wiki: | + | |
- | [[wiki: | + | |
+ | | ||
+ | */ | ||
Line 44: | Line 51: | ||
==== Generalizations ==== | ==== Generalizations ==== | ||
- | * [[principles:Low Coupling]]: The goal of LoD is to reduce coupling by reducing the knowledge of a class about other classes. | + | * [[Low Coupling]] |
- | * [[principles:Tell, Don't Ask]] | + | * [[Tell, Don't Ask/ |
==== Specializations ==== | ==== Specializations ==== | ||
Line 51: | Line 58: | ||
==== Contrary Principles ==== | ==== Contrary Principles ==== | ||
- | * [[principles:More Is More Complex]]: Adhering to the Law of Demeter often results in additional methods. | + | * [[More Is More Complex]] |
- | * [[principles:Low Coupling]]: Adhering to the Law of Demeter may create tramp couplings which are bad. | + | * [[Low Coupling]] |
- | * [[principles:High Cohesion]]: Adhering to the Law of Demeter often results in additional methods that mirror methods of aggregated objects. As these objects have other responsibilities, | + | * [[High Cohesion]] |
==== Complementary Principles ==== | ==== Complementary Principles ==== | ||
+ | |||
+ | * [[Model Principle]] (MP): Adhering to LoD may result in additional methods in aggregating classes. MP tells how they should look like. | ||
+ | |||
==== Principle Collections ==== | ==== Principle Collections ==== | ||
- | ===== Example | + | ===== Examples |
Line 80: | Line 90: | ||
* Phil Haack: // | * Phil Haack: // | ||
* [[http:// | * [[http:// | ||
+ | |||
+ | ===== Discussion ===== | ||
+ | |||
+ | Discuss this wiki article and the principle on the corresponding [[talk: | ||
+ |
principles/law_of_demeter.1355828473.txt.gz · Last modified: 2013-05-20 12:45 (external edit)