principles:encapsulate_the_concept_that_varies
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:encapsulate_the_concept_that_varies [2013-01-30 10:44] – OCP, SRP christian | principles:encapsulate_the_concept_that_varies [2021-09-02 19:36] – old revision restored (2021-05-11 21:52) 65.21.179.175 | ||
---|---|---|---|
Line 39: | Line 39: | ||
* [[Generalization Principle]] | * [[Generalization Principle]] | ||
+ | * [[Open-Closed Principle]] | ||
==== Specializations ==== | ==== Specializations ==== | ||
- | * [[Single Responsibility Principle]] (SRP): | + | * [[Single Responsibility Principle]] (SRP): |
- | * [[Open-Closed Principle]] (OCP): The OCP demands encapsulating abstract concepts in base classes (or interfaces) in order to be able to enhance the module by subclassing which is possible without changing the previously written code. In this case several variations of a concept may exist in the code at the same time. There is always the abstract base class plus one or usually more concrete subclasses. So the OCP is about encapsulating abstract concepts that vary "in space" | + | |
==== Contrary Principles ==== | ==== Contrary Principles ==== | ||
* [[More Is More Complex]] (MIMC): ECV demands adding a new class for a new varying concept. | * [[More Is More Complex]] (MIMC): ECV demands adding a new class for a new varying concept. | ||
- | * [[Keep It Simple Stupid]] (KISS): ECV demands adding a new class for a new varying concept. This adds complexity. | ||
* [[Model Principle]] (MP): ECV sometimes results in classes which do not correspond top a real-world concept in the sense of MP. A " | * [[Model Principle]] (MP): ECV sometimes results in classes which do not correspond top a real-world concept in the sense of MP. A " | ||
principles/encapsulate_the_concept_that_varies.txt · Last modified: 2021-10-18 21:31 by christian