1 Collection Types and Implementations in Object-Oriented Software Libraries Gisela Menger, James Leslie Keedy, Mark Evered, Axel Schmolitzky University of Ulm Abstract Collection classes are ideal candidates for software reuse and therefore have an important role in the development and use of object-oriented class libraries. In this paper we analyze representative collection libraries, pointing out the main problems from the viewpoint of their practical usability in programs. We then identify a small number of independent concepts relevant to the design of libraries of collections and show how an orthogonal treatment of these concepts can solve the problems identified. Because existing object-oriented languages, even newer ones, do not completely support all the relevant concepts (although most of the critical points are well-known), we show to what extent it would be possible to realize our proposals, and what remains as a challenge in the design of future languages. 1 1ntroduction Collection classes (sometimes called container classes) are classes such as sets and lists which allow instances of other classes to be treated as a collection. Such classes are ideal candidates for software reuse and therefore have an important role in the development and use of object-oriented class libraries. However, the designs of existing libraries are not without critics. It has been pointed out, for example, that — collection hierarchies are organized from an implementation viewpoint and have little to do with clients' use of the classes [9]. — to provide for future flexibility the introduction of many incrementally different types is needed, but huge hierarchies are hard to understand and to use [28]. — current methods of constructing such libraries are inherently unscalable [3]. To improve the usability of libraries of collection classes more emphasis must be placed on the user's (i.e. the client programmer's) point of view. It is of course impossible to take into account every special case, but some basic requirements can be formulated: • Collection types should be organized in a clear and understandable way, providing a succinct overview of which types are available, what their main properties are and how they can be adapted or extended to meet special needs. • The specification of a collection type should make its use clear without reference to its implementation properties. (In this paper type means an abstract data type, i.e. a specification of an abstract object without concern for the representation of its data or for the implementation of its operations.) • It should be possible for a collection type to have more than one implementation and it should be easy to change the decision which implementation of a collection type is used in a program. • Similar types should be designed using similar interfaces (e.g. with respect to the insertion, removal and selection of elements). • Orthogonal semantic properties of collections should be available in any combin- ation, e.g. "unordered without duplicates" but also "unordered with duplicates".