Reuse and combination with package templates

  • Authors:
  • Fredrik Sørensen;Eyvind W. Axelsen;Stein Krogdahl

  • Affiliations:
  • University of Oslo, Blindern, Oslo, Norway;University of Oslo, Blindern, Oslo, Norway;University of Oslo, Blindern, Oslo, Norway

  • Venue:
  • Proceedings of the 4th Workshop on MechAnisms for SPEcialization, Generalization and inHerItance
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

Package Templates (PT) is a mechanism for writing modules meant for reuse, where each module (template) consists of a collection of classes. Such a template must be instantiated in a program (at compile time) to form a set of ordinary classes, and during instantiation the classes may be adjusted with renaming and additional attributes. Package templates can be instantiated multiple times in the same program, each time with different adjustments and each time resulting in a fully independent set of classes. During instantiations, classes from two or more templates may be combined so that they get a new shared type with the properties from all the classes. This paper presents and discusses two proposed extensions to PT. The first has to do with the fact that PT naturally gets two variants of the "super" concept, where one is for ordinary superclasses, and the other is for the additions made to classes during instantiation. The second extension has to do with allowing templates to instantiate templates that are later to be specified.