ITWissen.info - Tech know how online

Genericity

Genericity a term of generic programming. It is the ability to parameterize classes by a type. Generalized the term of the Generizität can be applied also to functions, procedures and/or methods and their parameters. This means then the applicability e.g. of a sorting algorithm to arbitrary element types of a field. Despite the power of generic constructs, generic classes are only permitted in Eiffel, Ada and C++, for example.

Inheritance is the central concept of reusability in object-oriented software. Another important mechanism to support reusability is the so-called genericity, which, however, has not only been realized in object-oriented programming languages, e.g. also in Algol 68 and in Ada.

Genericity in object-oriented software is the possibility of defining parameterized classes. Such so-called generic classes are not directly usable, but define a template, a template, for the definition of usable classes. In general they have type parameters, which are called also formal generic parameters. Instances of a generic class are created by assigning actual types (actual generic parameters) to the formal generic parameters. Genericity is therefore useful only in statically typed programming languages, since dynamically typed languages do not know type parameters. Although a generic class is defined for a generic type parameter, static type checking can be performed because of the binding between the current and formal generic parameters specified for translation (by instantiation).

There are object-oriented languages that provide this concept, such as Eiffel and C++.

Informations:
Englisch: Genericity
Updated at: 14.11.2009
#Words: 239
Links: sorting algorithm, field, power (P), Eiffel, Ada
Translations: DE
Sharing:    

All rights reserved DATACOM Buchverlag GmbH © 2024