principles:principle_of_separate_understandability
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:principle_of_separate_understandability [2013-02-12 11:03] – strategies, statement, rationale, origin, evidence christian | principles:principle_of_separate_understandability [2021-09-02 20:44] – old revision restored (2021-05-19 09:48) 65.21.179.175 | ||
---|---|---|---|
Line 10: | Line 10: | ||
===== Principle Statement ===== | ===== Principle Statement ===== | ||
- | |||
- | Each module shall be understandable on its own -- without knowing anything about other modules. | ||
===== Description ===== | ===== Description ===== | ||
- | |||
- | PSU means that: | ||
- | * By looking at the public methods of a class it should be clear why they are there. That means there should be no method that is only there because a specific other module needs it. | ||
- | * By looking at the implementation of a module it should be clear how it works and why it was done that way. That means there should be no code that is solely there in order to make another module work. | ||
- | * By looking at a private method it should be clear what it does. That means there should be no (private) method that is only meaningful in the context of another method. | ||
===== Rationale ===== | ===== Rationale ===== | ||
- | |||
- | When a module is separately understandable, | ||
- | |||
- | Another point of view is that a violation of PSU either means that a part of the functionality does not belong to that module or the module has the wrong abstraction. So this is a sign of a design that needs improvement. | ||
===== Strategies ===== | ===== Strategies ===== | ||
- | When a module does not comply with PSU, this means that either a part of the functionality of the module does not belong here or the module has the wrong abstraction. So strategies for making a solution more compliant with PSU are: | ||
- | |||
- | * Move the conflicting functionality to another module where it fits better (see [[Tell don't Ask/ | ||
- | * Build up a new module for the conflicting functionality (see [[High Cohesion|HC]]). | ||
- | * Find the right abstraction for the module that allows the functionality to stay here (see [[Model Principle|MP]]). | ||
===== Origin ===== | ===== Origin ===== | ||
- | |||
- | This principle is newly proposed in this wiki. Nevertheless it is believed that it is not " | ||
===== 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: | * [[wiki: | ||
* [[wiki: | * [[wiki: | ||
Line 78: | Line 59: | ||
===== 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: | + | |
/ | / | ||
principles/principle_of_separate_understandability.txt · Last modified: 2021-10-18 22:13 by christian