Applying traits to the smalltalk collection classes

Traits are a programming language technology that promote the reuse of methods between unrelated classes. This paper reports on a refactoring of the Smalltalk collections classes using traits. The original collection classes contained much duplication of code; traits let us remove all of it. We also found places where the protocols of the collections lacked uniformity; traits allowed us to correct these non-uniformities without code duplication.Traits also make it possible to reuse fragments of collection code outside of the existing hierarchy; for example, they make it easy to convert other collection-like things into true collections. Our refactoring reduced the number of methods in the collection classes by approximately 10 per cent. More importantly, understandability maintainability and reusability of the code were significantly improved.

[1]  Nathanael Schärli,et al.  A browser for incremental programming , 2004, Comput. Lang. Syst. Struct..

[2]  Oscar Nierstrasz,et al.  Traits: Composable Units of Behaviour , 2002, ECOOP.

[3]  Oscar Nierstrasz,et al.  Traits: The Formal Model ? , 2003 .

[4]  Oscar Nierstrasz,et al.  A meta-model for language-independent refactoring , 2000, Proceedings International Symposium on Principles of Software Evolution.

[5]  David Thomas,et al.  Programming Ruby: the pragmatic programmer's guide , 2000 .

[6]  Stéphane Ducasse,et al.  A language independent approach for detecting duplicated code , 1999, Proceedings IEEE International Conference on Software Maintenance - 1999 (ICSM'99). 'Software Maintenance for Business Change' (Cat. No.99CB36360).

[7]  Don S. Batory,et al.  The Advanced Computing Systems Association 5 Th Usenix Conference on Object-oriented Technologies and Systems (coots '99) Automating Three Modes of Evolution for Object-oriented Software Architectures Automating Three Modes of Evolution for Object-oriented Software Architectures , 2022 .

[8]  Martin Fowler,et al.  Refactoring - Improving the Design of Existing Code , 1999, Addison Wesley object technology series.

[9]  Václav Rajlich,et al.  Reengineering object-oriented code , 1998, Proceedings. International Conference on Software Maintenance (Cat. No. 98CB36272).

[10]  Matthias Felleisen,et al.  Classes and mixins , 1998, POPL '98.

[11]  Sherman R. Alpert,et al.  The Design Patterns Smalltalk Companion , 1998 .

[12]  Ralph E. Johnson,et al.  A Refactoring Tool for Smalltalk , 1997, Theory Pract. Object Syst..

[13]  Ivan Moore,et al.  Automatic inheritance hierarchy restructuring and method refactoring , 1996, OOPSLA '96.

[14]  Marianne Huchard,et al.  On automatic class insertion with overloading , 1996, OOPSLA '96.

[15]  Antero Taivalsaari,et al.  On the notion of inheritance , 1996, CSUR.

[16]  Ralph Johnson,et al.  design patterns elements of reusable object oriented software , 2019 .

[17]  Ralph E. Johnson,et al.  Refactoring and Aggregation , 1993, ISOTAS.

[18]  Gilad Bracha,et al.  Strongtalk: typechecking Smalltalk in a production environment , 1993, OOPSLA '93.

[19]  Ralph E. Johnson,et al.  Creating abstract superclasses by refactoring , 1993, CSC '93.

[20]  M. Eiler Perspectives on software , 1992 .

[21]  William R. Cook,et al.  Interfaces and specifications for the Smalltalk-80 collection classes , 1992, OOPSLA.

[22]  Eduardo Casais,et al.  An Incremental Class Reorganization Approach , 1992, ECOOP.

[23]  William F. Opdyke,et al.  Refactoring object-oriented frameworks , 1992 .

[24]  Gilad Bracha,et al.  The programming language jigsaw: mixins, modularity and multiple inheritance , 1992 .

[25]  Wilf R. LaLonde,et al.  Inside Smalltalk (Volume 1) , 1990 .

[26]  Randall B. Smith,et al.  SELF: The power of simplicity , 1987, OOPSLA '87.

[27]  Larry Carter,et al.  Distrbution and Abstract Types in Emerald , 1987, IEEE Transactions on Software Engineering.

[28]  Andrew P. Black,et al.  Object structure in the Emerald system , 1986, OOPLSA '86.

[29]  James J. Horning,et al.  The Larch Family of Specification Languages , 1985, IEEE Software.

[30]  Luca Cardelli,et al.  A Semantics of Multiple Inheritance , 1984, Inf. Comput..

[31]  David Robson,et al.  Smalltalk-80: The Language and Its Implementation , 1983 .

[32]  O. J. Dahl,et al.  Simula Begin , 1979 .