Traits: experience with a language feature

  • Authors:
  • Emerson R. Murphy-Hill;Andrew P. Black

  • Affiliations:
  • The Evergreen State College, Olympia, WA;Oregon Health and Science University, Beaverton, OR

  • Venue:
  • OOPSLA '04 Companion to the 19th annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applications
  • Year:
  • 2004

Quantified Score

Hi-index 0.00

Visualization

Abstract

This paper reports our experiences using traits, collections of pure methods designed to promote reuse and understandability in object-oriented programs. Traits had previously been used to refactor the Smalltalk collection hierarchy, but only by the creators of traits themselves. This experience report represents the first independent test of these language features. Murphy-Hill implemented a substantialmulti-class data structure called ropes that makes significant use of traits. We found that traits improved understandability and reduced the number of methods that needed to be written by 46%.