principles:law_of_demeter
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:law_of_demeter [2021-09-02 12:32] – old revision restored (2021-05-19 11:21) 65.21.179.175 | principles:law_of_demeter [2021-09-02 12:32] – old revision restored (2021-05-19 11:21) 65.21.179.175 | ||
---|---|---|---|
Line 27: | Line 27: | ||
===== Strategies ===== | ===== Strategies ===== | ||
- | |||
- | |||
- | ===== Caveats ===== | ||
- | |||
- | See section [[#contrary principles]]. | ||
Line 39: | Line 34: | ||
===== 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 51: | Line 44: | ||
==== Generalizations ==== | ==== Generalizations ==== | ||
- | * [[Low Coupling]] | + | * [[principles:Low Coupling]]: The goal of LoD is to reduce coupling by reducing the knowledge of a class about other classes. |
- | * [[Tell, Don't Ask/ | + | * [[principles:Tell, Don't Ask]] |
==== Specializations ==== | ==== Specializations ==== | ||
Line 58: | Line 51: | ||
==== Contrary Principles ==== | ==== Contrary Principles ==== | ||
- | * [[More Is More Complex]] | + | * [[principles:More Is More Complex]]: Adhering to the Law of Demeter often results in additional methods. |
- | * [[Low Coupling]] | + | * [[principles:Low Coupling]]: Adhering to the Law of Demeter may create tramp couplings which are bad. |
- | * [[High Cohesion]] | + | * [[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, |
==== Complementary Principles ==== | ==== Complementary Principles ==== | ||
Line 67: | Line 60: | ||
- | ===== Examples | + | ===== Example |
Line 87: | Line 80: | ||
* Phil Haack: // | * Phil Haack: // | ||
* [[http:// | * [[http:// | ||
- |
principles/law_of_demeter.txt · Last modified: 2021-10-18 21:52 by christian