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

Tristan Bourgois 1 Jannik Laval 1 Stéphane Ducasse 1 Damien Pollet 1
1 RMOD - Analyses and Languages Constructs for Object-Oriented Application Evolution
LIFL - Laboratoire d'Informatique Fondamentale de Lille, Inria Lille - Nord Europe
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.
Document type :
Conference papers
Complete list of metadatas

Cited literature [18 references]  Display  Hide  Download

https://hal.inria.fr/inria-00511902
Contributor : Lse Lse <>
Submitted on : Friday, August 27, 2010 - 1:18:20 PM
Last modification on : Thursday, February 21, 2019 - 10:52:50 AM
Long-term archiving on : Thursday, December 1, 2016 - 9:20:49 AM

File

main.pdf
Files produced by the author(s)

Identifiers

  • HAL Id : inria-00511902, version 2

Citation

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⟩

Share

Metrics

Record views

475

Files downloads

267