The variability of software is a concept in an inheritance system.
Variability and diversity are synonymous with polymorphism.
The semantics are: subclasses of the same parent class, and the structure and function (behavior) are different under the condition that the parent interface constraints are satisfied.
Representation is a multiplicity of subclasses.
1) The Sub-class (data) structure is different;
2) The functional implementation of subclasses is different.
Variability in encapsulation:
Solidify something that is immutable.
1) at an abstract class or base class level, the variability is cured with specific interface constraints and fixed dependencies.
2) at the subclass level, each mutable shape of the variability is encapsulated into a specific subclass, causing it to lose its variability.
If there is no variable encapsulation, there is no stable dependency between the high-level or the abstraction layer;
Each of these implementations directly takes on a dependency between the underlying layer or the abstraction layer, leading to confusion in the code.
The variability of software