User Tools

Site Tools


principles:low_coupling

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
principles:low_coupling [2013-02-25 12:10] – IE christianprinciples:low_coupling [2021-09-02 20:34] – old revision restored (2021-03-29 03:10) 65.21.179.175
Line 36: Line 36:
   * Merge modules:   * Merge modules:
   * Hide information   * Hide information
- 
-===== Caveats ===== 
- 
-Coupling can be reduced by several technical measures (see [[#strategies]]). But while these measures reduce the coupling technically, they do not necessarily reduce the logical coupling. In such a case two modules A and B may seem decoupled, but ripple effects may occur anyway because of the logical coupling. In such a case it is better to make the coupling explicit by not applying a decoupling strategy. It may also be possible to find a better suitable strategy or a better way of applying the strategy to also get rid of the logical coupling. 
- 
-Furthermore note that coupling to a stable module is often no problem. The problematic cases are couplings to unstable modules. This means that applying decoupling strategies is beneficial when a coupling to an unstable module is reduced. But it may not be beneficial in the other cases. 
- 
-See also section [[#contrary principles]]. 
- 
  
 ===== Origin ===== ===== Origin =====
Line 66: Line 57:
 ==== Specializations ==== ==== Specializations ====
  
 +  * [[Tell, don't Ask/Information Expert]] (TdA/IE): Adhering to the information expert principle leads to low coupling as there is less need to communicate with other modules to get the necessary information.
   * [[Constantine's Law]]: Constantine's Law is just the combination of the two principles LC and HC.   * [[Constantine's Law]]: Constantine's Law is just the combination of the two principles LC and HC.
   * [[Dependency Inversion Principle]] (DIP): LC aims at reducing the dependencies to other modules. One way to do so is to only depend on abstractions. DIP is about this aspect.   * [[Dependency Inversion Principle]] (DIP): LC aims at reducing the dependencies to other modules. One way to do so is to only depend on abstractions. DIP is about this aspect.
Line 76: Line 68:
 ==== Complementary Principles ==== ==== Complementary Principles ====
  
-  * [[Tell, don't Ask/Information Expert]] (TdA/IE): IE may help to reduce coupling. Although there are also contrary cases (see [[Tell, don't Ask/Information Expert#caveats]]). 
   * [[Model Principle]] (MP): LC aims at reducing the dependencies to other modules. So a module shall depend on only a few others. MP now tells which dependencies are allowed and which aren't.   * [[Model Principle]] (MP): LC aims at reducing the dependencies to other modules. So a module shall depend on only a few others. MP now tells which dependencies are allowed and which aren't.
   * [[Information Hiding/Encapsulation]] (IH/E): Higher forms of couplings (especially content couplings) break encapsulation.   * [[Information Hiding/Encapsulation]] (IH/E): Higher forms of couplings (especially content couplings) break encapsulation.
principles/low_coupling.txt · Last modified: 2021-10-18 21:49 by christian