The Bridge Pattern decouples an abstraction from its implementation in order to let them vary independently.
The following summary shows us how CKJM Metrics have been affected in this project after having applied the Bridge Pattern:
CKJM Metric | Without the Pattern | With the Pattern |
---|---|---|
WMC: Weighted methods per class | 3.66 | 3.28 |
DIT: Depth of Inheritance Tree | 1 | 1 |
NOC: Number of Children | 0 | 0 |
CBO: Coupling between object classes | 3.66 | 3.71 |
RFC: Response for a Class | 6 | 5.28 |
LCOM: Lack of cohesion in methods | 1.2 | 2 |
Ca: Afferent coupling (not a C&K metric) | 1.5 | 1.71 |
NPM: Number of Public Methods for a class (not a C&K metric) | 2.16 | 1 |