Title
Composing Classes - Roles Vs Traits.
Abstract
Code replication has significant drawbacks in system maintenance. Code replication can have its origins in the composition limitations of the language. Several proposals have tried to overcome these limitations. A popular one is traits. However, traits do not support state or visibility control. Static roles are also a way of composing classes that has the benefits of traits and offers state, visibility control and other advantages as block renaming. We compare both approaches on how they are used to compose classes, and how they can be used to reduce code replication caused by composition limitations. As a case study we will compare how both approaches can reduce code replication by detecting and removing code clones within the JHotDraw framework. Results show that roles are capable of reducing a larger amount of replicated code than traits.
Year
DOI
Venue
2013
10.5220/0004424000630073
ENASE: PROCEEDINGS OF THE 8TH INTERNATIONAL CONFERENCE ON EVALUATION OF NOVEL APPROACHES TO SOFTWARE ENGINEERING
Keywords
DocType
Citations 
Roles,Traits,Code Reuse,Modularity,Composition,Inheritance
Conference
0
PageRank 
References 
Authors
0.34
0
2
Name
Order
Citations
PageRank
Fernando Sérgio Barbosa183.20
Ademar Aguiar215427.13