• DocumentCode
    3142638
  • Title

    Are your incoming aliases really necessary? Counting the cost of object ownership

  • Author

    Potanin, Alex ; Damitio, Monique ; Noble, James

  • Author_Institution
    Victoria Univ. of Wellington, Wellington, New Zealand
  • fYear
    2013
  • fDate
    18-26 May 2013
  • Firstpage
    742
  • Lastpage
    751
  • Abstract
    Object ownership enforces encapsulation within object-oriented programs by forbidding incoming aliases into objects´ representations. Many common data structures, such as collections with iterators, require incoming aliases, so there has been much work on relaxing ownership´s encapsulation to permit multiple incoming aliases. This research asks the opposite question: Are your aliases really necessary? In this paper, we count the cost of programming with strong object encapsulation. We refactored the JDK 5.0 collection classes so that they did not use incoming aliases, following either the owner-as-dominator or the owner-as-accessor encapsulation discipline. We measured the performance time overhead the refactored collections impose on a set of microbenchmarks and on the DaCapo, SPECjbb and SPECjvm benchmark suites. While the microbenchmarks show that individual operations and iterations can be significantly slower on encapsulated collection (especially for owner-as-dominator), we found less than 3% slowdown for owner-as-accessor across the large scale benchmarks. As a result, we propose that well-known design patterns such as Iterator commonly used by software engineers around the world need to be adjusted to take ownership into account. As most design patterns are used as a building block in constructing larger pieces of software, a small adjustment to respect ownership will not have any impact on the productivity of programmers but will have a huge impact on the quality of the resulting code with respect to aliasing.
  • Keywords
    data encapsulation; object-oriented programming; security of data; DaCapo benchmark suites; Iterator; JDK 5.0 collection classes; SPECjbb benchmark suites; SPECjvm benchmark suites; data structures; design patterns; microbenchmarks; object encapsulation; object oriented programs; object ownership; object representations; owner-as-accessor; ownership encapsulation; programming cost; software engineers; Arrays; Benchmark testing; Encapsulation; Java; Software; Standards; Vectors;
  • fLanguage
    English
  • Publisher
    ieee
  • Conference_Titel
    Software Engineering (ICSE), 2013 35th International Conference on
  • Conference_Location
    San Francisco, CA
  • Print_ISBN
    978-1-4673-3073-2
  • Type

    conf

  • DOI
    10.1109/ICSE.2013.6606620
  • Filename
    6606620