principles:uniformity_principle
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:uniformity_principle [2021-05-19 09:49] – old revision restored (2021-05-11 17:19) 2a04:ac00:4:d29:5054:ff:fe00:d387 | principles:uniformity_principle [2021-09-02 12:50] – old revision restored (2021-05-19 09:48) 65.21.179.175 | ||
---|---|---|---|
Line 11: | Line 11: | ||
===== Principle Statement ===== | ===== Principle Statement ===== | ||
+ | Solve similar problems the same way. | ||
===== Description ===== | ===== Description ===== | ||
Line 49: | Line 50: | ||
==== Contrary Principles ==== | ==== Contrary Principles ==== | ||
+ | |||
+ | Note that UP can be contrary to virtually every other principle as it demands neglecting other principles in favor of uniformity. | ||
* [[Keep It Simple Stupid]] (KISS): Sometimes UP demands more complex solutions because they are already applied elsewhere and for the sake of uniformity shall also be applied in simpler contexts where they would not be necessary. | * [[Keep It Simple Stupid]] (KISS): Sometimes UP demands more complex solutions because they are already applied elsewhere and for the sake of uniformity shall also be applied in simpler contexts where they would not be necessary. | ||
- | * [[Model Principle]] (MP): UP may demand adhering to a certain naming scheme, which may not be best with respect to MP. | + | * [[Model Principle]] (MP): UP may demand adhering to a certain naming scheme, which may not be best with respect to MP. See [[#example 1: naming schemes]]. |
==== Complementary Principles ==== | ==== Complementary Principles ==== | ||
- | * [[Principle of Least Surprise]] (PLS): When applying UP, PLS should also be considered for naming modules. | + | * [[Principle of Least Surprise]] (PLS): When applying UP, PLS should also be considered for naming modules. |
Line 62: | Line 66: | ||
{{page> | {{page> | ||
- | ===== Example ===== | + | |
+ | ===== Examples ===== | ||
+ | |||
+ | ==== Example | ||
+ | |||
+ | A typical example of the application of UP is the naming of method identifiers for common container classes like [[glossary: | ||
+ | |||
+ | Stacks typically have the methods '' | ||
+ | |||
+ | Queues on the other hand typically have the methods '' | ||
+ | |||
+ | A third possibility is to find a common abstraction and to apply a very general naming scheme to all descendant classes (stack classes, queue classes and others). This is the way it is done in Eiffel((see Bertrand Meyer: // | ||
principles/uniformity_principle.txt · Last modified: 2021-10-18 22:00 by christian