Software components can be implemented and distributed as collections of classes, then adapted to the needs of specific applications by means of subclassing. Unfortunately, subclassing in collections of related classes may require re-implementation of otherwise valid classes just because they utilize outdated parent classes, a phenomenon that is referred to as the subclassing anomaly. The subclassing anomaly is a serious problem since it can void the benefits of component-based programming altogether. We propose a code adaptation language mechanism called class overriding that is intended to overcome the subclassing anomaly. Class overriding does not create new and isolated derived classes as subclassing does, but rather extends and updates existing classes across collections of related classes. If adopted in new languages for component-based programming, or in existing compiled languages such as C# and Java, class overriding can help maintain the integrity of evolving collections of related classes and thus enhance software component adaptability. While other techniques such as reflection and binary code adaptation can be used to reduce the magnitude of the subclassing anomaly, class overriding has the advantage of being easy-to-use and efficient.
Radenski, A. Anomaly-Free Component Adaptation with Class Overriding. Journal of Systems and Software, Elsevier Science, Vol. 71, Issues 1-2, 2004, 37-48. doi: 10.1016/S0164-1212(02)00137-1
Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 4.0 License.