Commonality-variability analysis
"commonality variability analysis"是我在阅读wikipedia Modern C++ Design # Policy-based design时,发现的:
The main idea is to use commonality-variability analysis to divide the type into the fixed implementation and interface, the policy-based class, and the different policies. The trick is to know what goes into the main class, and what policies should one create.
Implementation
"Commonality-variability analysis"告诉了我们分析方法,在进行实现的时候,我们可以采取:
Program to an abstraction and polymorphism
commonality 公共,对应的是code reuse;
variability 可变,差异,对应的是abstraction 和 polymorphism;
Example
在 jianshu 策略模式(Strategy Pattern) 中也涉及了这个topic。
TODO
informit Commonality/Variability and Abstract Classes
https://www.oreilly.com/library/view/essential-skills-for/9780321700469/ch10.html
https://www.dre.vanderbilt.edu/~schmidt/PDF/Commonality_Variability.pdf