Implementing type-safe software product lines using parametric traits

Autor: Ina Schaefer, Ferruccio Damiani, Lorenzo Bettini
Rok vydání: 2015
Předmět:
Zdroj: Science of Computer Programming. 97:282-308
ISSN: 0167-6423
DOI: 10.1016/j.scico.2013.07.016
Popis: A software product line (SPL) is a set of related software systems with well-defined commonality and variability that are developed by reusing common artifacts. In this paper, we present a novel technique for implementing SPLs by exploiting mechanisms for fine-grained reuse which are orthogonal to class-based inheritance. In our approach the concepts of type, behavior, and state are separated into different and orthogonal linguistic concepts: interfaces, traits and classes, respectively. We formalize our proposal by means of Featherweight Parametric Trait Java (FPTJ), a minimal core calculus where units of product functionality are modeled by parametric traits. Traits are a well-known construct for fine-grained reuse of behavior. Parametric traits are traits parameterized by interface names and class names. Parametric traits are applied to interface names and class names to generate traits that can be assembled in other (possibly parametric) traits or in classes that are used to build products. The composition of product functionality is realized by explicit operators of the calculus, allowing code manipulations for modeling product variability. The FPTJ type system ensures that the products in the SPL are type-safe by inspecting the parametric traits and classes shared by different products only once. Therefore, type-safety of an extension of a (type-safe) FPTJ SPL can be guaranteed by inspecting only the newly added parts. We present a technique for implementing SPLs by mechanisms for fine-grained reuse.We formalize our proposal by means of a minimal core calculus.The type system ensures that all the products in the SPL are type-safe.Type-safety of SPL extensions can be checked by inspecting only newly added parts.
Databáze: OpenAIRE