Class inheritance and method overriding, as provided by standard class-based languages, are not flexible enough to represent the dynamic behavior of objects; with this respect, object composition and delegation are often advocated as a more flexible alternative to class inheritance since they act at run-time, thus permitting the behavior of objects to be specialized dynamically. In this paper we present Incomplete Featherweight Java (IFJ), an extension of Featherweight Java with incomplete objects, i.e., objects that require some missing methods which can be provided at run-time by composition with another (complete) object. The mechanism for method invocation is based on delegation and it is disciplined by static typing, therefore the language enjoys type safety (which implies no "message-not-understood" run-time errors) and avoids possible accidental overrides due to method clashes.

Type Safe Dynamic Object Delegation in Class-based Languages / Lorenzo Bettini; Viviana Bono. - STAMPA. - -:(2008), pp. 171-180. (Intervento presentato al convegno PPPJ 2008 - 6th International Symposium on Principles and Practice of Programming in Java tenutosi a Modena, Italy nel 9-11 settembre 2008) [10.1145/1411732.1411756].

Type Safe Dynamic Object Delegation in Class-based Languages

BETTINI, LORENZO;
2008

Abstract

Class inheritance and method overriding, as provided by standard class-based languages, are not flexible enough to represent the dynamic behavior of objects; with this respect, object composition and delegation are often advocated as a more flexible alternative to class inheritance since they act at run-time, thus permitting the behavior of objects to be specialized dynamically. In this paper we present Incomplete Featherweight Java (IFJ), an extension of Featherweight Java with incomplete objects, i.e., objects that require some missing methods which can be provided at run-time by composition with another (complete) object. The mechanism for method invocation is based on delegation and it is disciplined by static typing, therefore the language enjoys type safety (which implies no "message-not-understood" run-time errors) and avoids possible accidental overrides due to method clashes.
2008
Proceedings of the 6th International Symposium on Principles and Practice of Programming in Java, PPPJ 2008
PPPJ 2008 - 6th International Symposium on Principles and Practice of Programming in Java
Modena, Italy
9-11 settembre 2008
Lorenzo Bettini; Viviana Bono
File in questo prodotto:
Non ci sono file associati a questo prodotto.

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

Utilizza questo identificatore per citare o creare un link a questa risorsa: https://hdl.handle.net/2158/1039573
Citazioni
  • ???jsp.display-item.citation.pmc??? ND
  • Scopus 6
  • ???jsp.display-item.citation.isi??? ND
social impact