In order to deal with the problem of incompatible interfaces, Command Pattern allows convert the one incompatible into another that the client expects:
The following summary shows us how CKJM Metrics have been affected in this project after having applied the Command Pattern:
CKJM Metric | Without the Pattern | With the Pattern |
---|---|---|
WMC: Weighted methods per class | 3.11 | 3.3 |
DIT: Depth of Inheritance Tree | 1 | 1 |
NOC: Number of Children | 0 | 0 |
CBO: Coupling between object classes | 3.66 | 3.6 |
RFC: Response for a Class | 6.44 | 6.4 |
LCOM: Lack of cohesion in methods | 0.88 | 0.5 |
Ca: Afferent coupling (not a C&K metric) | 1.11 | 1.1 |
NPM: Number of Public Methods for a class (not a C&K metric) | 2.55 | 2.5 |