REVERSE GENERICS - Parametrization after the Fact

Alexandre Bergel, Lorenzo Bettini

2009

Abstract

By abstracting over types, generic programming enables one to write code that is independent from specific data type implementation. This style is supported by most mainstream languages, including C++ with templates and Java with generics. If some code is not designed in a generic way from the start, a major effort is required to convert this code to use generic types. This conversion is manually realized which is known to be tedious and error-prone. We propose Reverse Generics, a general linguistic mechanism to define a generic class from a non-generic class. For a given set of types, a generic is formed by unbinding static dependencies contained in these types. This generalization and generic type instantiation may be done incrementally. This paper studies the possible application of this linguistic mechanism to C++ and Java and, in particular, it reviews limitations of Java generics against our proposal.

Download


Paper Citation


in Harvard Style

Bergel A. and Bettini L. (2009). REVERSE GENERICS - Parametrization after the Fact . In Proceedings of the 4th International Conference on Software and Data Technologies - Volume 1: ICSOFT, ISBN 978-989-674-009-2, pages 39-46. DOI: 10.5220/0002252700390046

in Bibtex Style

@conference{icsoft09,
author={Alexandre Bergel and Lorenzo Bettini},
title={REVERSE GENERICS - Parametrization after the Fact},
booktitle={Proceedings of the 4th International Conference on Software and Data Technologies - Volume 1: ICSOFT,},
year={2009},
pages={39-46},
publisher={SciTePress},
organization={INSTICC},
doi={10.5220/0002252700390046},
isbn={978-989-674-009-2},
}


in EndNote Style

TY - CONF
JO - Proceedings of the 4th International Conference on Software and Data Technologies - Volume 1: ICSOFT,
TI - REVERSE GENERICS - Parametrization after the Fact
SN - 978-989-674-009-2
AU - Bergel A.
AU - Bettini L.
PY - 2009
SP - 39
EP - 46
DO - 10.5220/0002252700390046