principles:encapsulate_the_concept_that_varies
This is an old revision of the document!
Table of Contents
Encapsulate the Concept that Varies (ECV)
Variants and Alternative Names
Context
Principle Statement
Encapsulate the Concept that Varies, i.e. a design is better when those parts that vary are encapsulated in a separate module.
Description
Rationale
Strategies
Origin
Evidence
Relations to Other Principles
Generalizations
Specializations
Contrary Principles
- More Is More Complex (MIMC): ECV demands adding a new class for a new varying concept.
- Model Principle (MP): ECV sometimes results in classes which do not correspond top a real-world concept in the sense of MP. A “concept that varies” can also be a technical concept.
Complementary Principles
- Dependency Inversion Principle (DIP): ECV may result in the creation of abstract classes (i.e. the concepts) and descendant concrete classes (i.e. the variations). DIP now tells that other classes should only depend on the abstractions.
Principle Collections
Example
Description Status
Further Reading
- Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides: Design Patterns: Elements of Reusable Object-Oriented Software, p. 29
- Bertrand Meyer: Object-Oriented Software Construction, p. 57pp.
- Robert C. Martin: Agile Software Development, Principles, Patterns, and Practices, p. 99pp.
principles/encapsulate_the_concept_that_varies.1630578374.txt.gz · Last modified: 2021-09-02 12:26 by 65.21.179.175