Abstract
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 am KIT | Institut für Programmstrukturen und Datenorganisation (IPD) |
|---|---|
| Sprache | englisch |
| KITopen-ID | 1000188547 |
| Schlagwörter | constructors, mixins, object initialization, reusability |
| Verlag | Association for Computing Machinery (ACM) |
| ISBN des Proceedingsbands | 978-1-4503-2373-4 |
| Veranstaltung | 12th International Conference on Generative Programming: Concepts and Experiences (GPCE), Indianapolis, IN, USA, 27. – 28.10.2013 |
| Nachgewiesen in | Web of Science Scopus Dimensions OpenAlex |