FJMIP: a calculus for a modular object initialization

  • Authors:
  • Viviana Bono;Jarosław D. M. Kuśmierek

  • Affiliations:
  • Torino University, Department of Computer Science;Warsaw University, Institute of Informatics

  • Venue:
  • FCT'07 Proceedings of the 16th international conference on Fundamentals of Computation Theory
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

Abstract

In most mainstream object-oriented languages, the object initialization protocol is based on constructors, where different constructors of the same class are, in fact, overloaded variants of the same method. This approach has some disadvantages: it forces an exponential growth of the code with respect to the number of properties, it may cause duplication of code, and it may create unnecessary code dependencies. To the best of our knowledge, the literature lacks formal proposals that model non-trivial object initialization protocols. In this paper we present a calculus (called FJMIP), which is an extension of the Igarashi-Pierce-Wadler Featherweight Java and models a novel object initialization protocol. Our calculus is reasonably simple, but it offers two benefits: (i) it formalizes a modular way of initializing objects that does not suffer from the previous mentioned flaws, while still being an expressive object initialization protocol; (ii) as a by-product, it allowed us to introduce a novel technique to prove that our object initialization process actually initializes all the fields of an object.