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.

Implementing type-safe software product lines using parametric traits

BETTINI, LORENZO;DAMIANI, Ferruccio;
2015-01-01

Abstract

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.
2015
97
P3
282
308
http://www.sciencedirect.com/science/article/pii/S0167642313001901
Type system; Trait; Software product line; Feature model; Featherweight Java
Lorenzo Bettini;Ferruccio Damiani;Ina Schaefer
File in questo prodotto:
File Dimensione Formato  
main_4aperto_1245214.pdf

Open Access dal 18/08/2015

Tipo di file: POSTPRINT (VERSIONE FINALE DELL’AUTORE)
Dimensione 335.15 kB
Formato Adobe PDF
335.15 kB Adobe PDF Visualizza/Apri
SCP-bds-2015.pdf

Accesso riservato

Tipo di file: PDF EDITORIALE
Dimensione 540.65 kB
Formato Adobe PDF
540.65 kB Adobe PDF   Visualizza/Apri   Richiedi una copia

I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/2318/153135
Citazioni
  • ???jsp.display-item.citation.pmc??? ND
  • Scopus 10
  • ???jsp.display-item.citation.isi??? 5
social impact