KIT | KIT-Bibliothek | Impressum | Datenschutz

Template Constructors for Reusable Object Initialization

Martin, Marko; Mezini, Mira; Erdweg, Sebastian ORCID iD icon 1
1 Institut für Programmstrukturen und Datenorganisation (IPD), Karlsruher Institut für Technologie (KIT)

Abstract (englisch):

Reuse of and abstraction over object initialization logic is not properly supported in mainstream object-oriented languages. This may result in significant amount of boilerplate code and proliferation of constructors in subclasses. It also makes it impossible for mixins to extend the initialization interface of classes they are applied to. We propose template constructors, which employ template parameters and pattern matching of them against signatures of superclass constructors to enable a one-to-many binding of super-calls. We demonstrate how template constructors solve the aforementioned problems. We present a formalization of the concept, a Java-based implementation, and use cases which exercise its strengths.


Zugehörige Institution(en) am KIT Institut für Programmstrukturen und Datenorganisation (IPD)
Publikationstyp Proceedingsbeitrag
Publikationsjahr 2013
Sprache Englisch
Identifikator ISBN: 978-1-4503-2373-4
KITopen-ID: 1000188547
Erschienen in Proceedings of the 12th International Conference on Generative Programming: Concepts and Experiences; Indianapolis, IN, USA, 27.-28.10.2013
Veranstaltung 12th International Conference on Generative Programming: Concepts and Experiences (GPCE 2013), Indianapolis, IN, USA, 27.10.2013 – 28.10.2013
Verlag Association for Computing Machinery (ACM)
Seiten S. 43–52
Schlagwörter constructors; mixins; object initialization; reusability
Nachgewiesen in Scopus
KIT – Die Universität in der Helmholtz-Gemeinschaft
KITopen Landing Page