Object-oriented class-based languages provide mechanisms for the initialization of newly created objects. These mechanisms specify how an object is initialized and what information is needed to do so. The initialization protocol is usually implemented as a list of constructors. It is often the case that the initialization protocol concerns some orthogonal properties of objects. Unfortunately, if those properties have more than one option of initialization, the total number of constructors becomes exponential in the number of properties. In this paper, we propose an alternative protocol. In our approach, instead of defining a list of constructors, it is possible to split blocks of definitions into smaller and composable pieces, in order to obtain reduction in the size of the code, better reusability, more expressiveness, and easier maintenance.

Modularizing constructors

BONO, Viviana;
2007-01-01

Abstract

Object-oriented class-based languages provide mechanisms for the initialization of newly created objects. These mechanisms specify how an object is initialized and what information is needed to do so. The initialization protocol is usually implemented as a list of constructors. It is often the case that the initialization protocol concerns some orthogonal properties of objects. Unfortunately, if those properties have more than one option of initialization, the total number of constructors becomes exponential in the number of properties. In this paper, we propose an alternative protocol. In our approach, instead of defining a list of constructors, it is possible to split blocks of definitions into smaller and composable pieces, in order to obtain reduction in the size of the code, better reusability, more expressiveness, and easier maintenance.
2007
vol. 6, no. 9
297
317
http://www.jot.fm/issues/issue_2007_10/paper15/index.html
V. BONO; J. KUS'MIEREK
File in questo prodotto:
Non ci sono file associati a questo prodotto.

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/29029
Citazioni
  • ???jsp.display-item.citation.pmc??? ND
  • Scopus 1
  • ???jsp.display-item.citation.isi??? ND
social impact