Generic classes allow, through type parameters instantiation, to obtain new classes adapted to different contexts. Therefore, genericity is an important support for class reuse. When the possibility of reusing a class to deal with elements of different domains arises, is desirable to have the appropriated generic class. Nevertheless, the construction of generic classes is a task that must be planned in advance. Hence, the possibility of reusing a class in other domain can appear but maybe the class is not prepared for this. In this paper we present the definition of a class restructuring operator which allows to obtain generic classes from non-generic classes. The operator is named parameterize. Particularly, in this paper, we present the operator definition for an environment that supports reuse of Eiffel classes. First, we present briefly the operator and later we are going to focus on the aspects concerned with how to obtain a restriction class to constrain generic parameters. All these aspects are introduced using examples.
Index Terms:
object oriented programming, reuse, restructuring classes, reorganizing hierarchies, Eiffel, constrained genericity
Citation:
Yania Crespo, Juan José Rodríguez, José Manuel Marqués, "Obtaining Generic Classes Automatically through a Parameterization Operator: A Focus on Constrained Genericity," tools, pp.166, 31st International Conference on Technology of Object-Oriented Language and Systems, 1999