The Construction Principles of the Class Library Karla
This article shows how to construct robust class libraries in the context of flexibility, implementation efficiency and extensibility as further design goals. A library is called robust if (1) no errors can be introduced into an application due to its use or inheritance from it, (2) error messages do not point deep into library code but into the user’s application, and (3) statically checkable incorrect uses of library classes are recognized by compilers. The principles derived from a theoretical analysis have been applied practically in Karla, a robust class library of data structures and algorithms the authors designed and implemented, and that is being used for research projects and student education.
The main focus of this article is on the construction of hierarchies of abstract classes. The analysis shows that it is not possible in general to achieve all of the above design goals for robust libraries at the same time. The only solution that ensures robustness is to drop one of these criteria. Redesigning an existing library for robustness may lead to an exponential growth in the number of classes in the hierarchy of abstract classes. However, it is shown that this class explosion can be controlled by automatically generating the required additional classes.
KeywordsGeneric Parameter Abstract Classis Class Library Construction Principle Conformance Relation
Unable to display preview. Download preview PDF.
- 1.G. Booch. Object-Oriented Design with Applications. Benjamin/Cummings Publishing Company, 1991.Google Scholar
- 2.K. K. Dhara and G. T. Leavens. Forcing behavioral subtyping through specification inheritance. In Proceedings 18th International Conference on Software Engineering, pages 258–267. IEEE, 1996.Google Scholar
- 3.A. Frick, R. Neumann, and W. Zimmermann. A method for the construction of robust class hierarchies. In Proceedings of WOON’ 96, 1996.Google Scholar
- 4.A. Frick, W. Zimmer, and W. Zimmermann. On the design of reliable libraries. In TOOLS 17—Technology of Object-Oriented Programming, pages 13–23, 1995.Google Scholar
- 7.Jozsef Frigo, Rainer Neumann, and Wolf Zimmermann. Generation of robust class hierarchies. In TOOLS 23—Technology of Object-Oriented Programming and Systems, pages 282–291, 1997.Google Scholar
- 8.E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns: Elements of Reusable Software Components. Addison-Wesley, 1995.Google Scholar
- 10.R. Mitchell, I. Maung, J. Howse, and T. Heathcote. Checking software contracts. In R. Ege, M. Singh, and B. Meyer, editors, TOOLS 17-Technology of Object-Oriented Languages and Systemes, pages 97–106, 1995.Google Scholar
- 11.H. Rumbaugh, M. Blaha, W. Premerlani, F. Eddy, and W. Lorensen. Object-Oriented Modelling and Design. Prentice-Hall, 1991.Google Scholar
- 12.H. W. Schmidt and R. Walker. TOF: An efficient type system for objects and functions. Technical Report TR-CS-92-17, Department of Computer Science, The Australian National University, November 1992.Google Scholar