Paper

Type
ARTICLE  
Title
Delegation by object composition  
Authors
Lorenzo Bettini, Viviana Bono, Betti Venneri 
Book
Science of Computer Programming  
Pages
992-1014  
Abstract
Class inheritance and method overriding, as provided by standard class-based languages, are often not flexible enough to represent objects with some dynamic behavior. In this respect, object composition equipped with different forms of method body lookup is often advocated as a more flexible alternative to class inheritance since it takes place at run time, thus permitting the behavior of objects to be specialized dynamically. In this paper, we illustrate Incomplete Featherweight Java (IFJ), an extension of Featherweight Java with a novel linguistic construct, the incomplete object. Incomplete objects require some missing methods which can be provided at run time by composition with another (complete) object. Furthermore, we present two mechanisms for the method body lookup on (composed) objects, one based on delegation and the other based on consultation. Thanks to the design of the language, the consultation-based lookup is a simple extension of the delegation-based one. Both mechanisms are 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 name clashes.  
Volume
76  
Number
11  
Year
2011  
Bibtex key
BBV2010  
Paper Url1
http://dx.doi.org/10.1016/j.scico.2010.04.006  
Bibtex
@ARTICLE{BBV2010,
  title = {{Delegation by object composition}},
  author = {Bettini, Lorenzo and Bono, Viviana and Venneri, Betti},
  journal = {Science of Computer Programming},
  pages = {992-1014},
  abstract = {Class inheritance and method overriding, as provided by standard
      class-based languages, are often not flexible enough to represent
      objects with some dynamic behavior. In this respect, object
      composition equipped with different forms of method body lookup is
      often advocated as a more flexible alternative to class
      inheritance since it takes place at run time, thus permitting the
      behavior of objects to be specialized dynamically. In this paper,
      we illustrate Incomplete Featherweight Java (IFJ), an extension of
      Featherweight Java with a novel linguistic construct, the
      incomplete object. Incomplete objects require some missing methods
      which can be provided at run time by composition with another
      (complete) object. Furthermore, we present two mechanisms for the
      method body lookup on (composed) objects, one based on delegation
      and the other based on consultation. Thanks to the design of the
      language, the consultation-based lookup is a simple extension of
      the delegation-based one. Both mechanisms are 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 name clashes.
      },
  volume = {76},
  number = {11},
  year = {2011},
  url = {http://dx.doi.org/10.1016/j.scico.2010.04.006},
  publisher = {Elsevier},
}
 
Created
0000-00-00 00:00:00  
Modified
2011-06-10 13:42:53