This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
principles:high_cohesion [2019-05-29 14:50] 154.114.16.134 [Examples] |
principles:high_cohesion [2019-05-29 15:09] christian old revision restored (2016-09-03 22:52) |
||
---|---|---|---|
Line 20: | Line 20: | ||
The cohesion of a module is a measure for how well the internal parts of a module (e.g. the methods and attributes of a class) belong together. Having a high cohesion means, that a module should only comprise responsibilities which belong together. | The cohesion of a module is a measure for how well the internal parts of a module (e.g. the methods and attributes of a class) belong together. Having a high cohesion means, that a module should only comprise responsibilities which belong together. | ||
- | Several kinds of cohesion can be distinguished some of which are strong and some of which are loose. So strong forms of coupling should be preferred. | + | Several kinds of cohesion can be distinguished some of which are strong and some of which are loose. So strong forms of coupling should be preferred: FIXME add explanation of cohesion types |
===== Rationale ===== | ===== Rationale ===== | ||
Line 26: | Line 27: | ||
+ | ===== Strategies ===== | ||
+ | * Divide one large module into several smaller but more cohesive ones | ||
===== Caveats ===== | ===== Caveats ===== | ||
Line 35: | Line 38: | ||
===== Origin ===== | ===== Origin ===== | ||
- | W. P. Stevens, | + | W. P. Stevens, |
===== Evidence ===== | ===== Evidence ===== | ||
Line 76: | Line 79: | ||
===== Examples ===== | ===== Examples ===== | ||
- | The donkey is good. The site is not working | ||