BLOC: a Trait-Based Collections Library – a Preliminary Experience Report - Inria - Institut national de recherche en sciences et technologies du numérique
Conference Papers Year : 2010

BLOC: a Trait-Based Collections Library – a Preliminary Experience Report

Abstract

A trait is a programming construct which provides code reusability. Traits are groups of methods that can be reused orthogonally from inheritance. Traits offer a solution to the problems of multiple inheritance by providing a behavior-centric modularity. Since traits offer an alternative to traditional inheritance-based code reuse, a couple of questions arise. For example, what is a good granularity for a Trait enabling reuse as well as plug ease? How much reuse can we expect on large existing inheritance-based hierarchies? In this paper we take as case study the Smalltalk Collection hierarchy and we start rewriting it from scratch using traits from the beginning. We show how such library can be built using traits and we report such a preliminary experience. Since the Collection library is large, we focused and built the main classes of the library with Traits and report problems we encountered and how we solved them. Results of this experience are positive and show that we can build new collections based on the traits used to define the new library kernel.
Fichier principal
Vignette du fichier
main.pdf (419.08 Ko) Télécharger le fichier
Origin Files produced by the author(s)
Loading...

Dates and versions

inria-00511902 , version 1 (26-08-2010)
inria-00511902 , version 2 (27-08-2010)

Identifiers

  • HAL Id : inria-00511902 , version 2

Cite

Tristan Bourgois, Jannik Laval, Stéphane Ducasse, Damien Pollet. BLOC: a Trait-Based Collections Library – a Preliminary Experience Report. International Workshop on Smalltalk Technologies, Sep 2010, Barcelona, Spain. ⟨inria-00511902v2⟩
320 View
207 Download

Share

More