Loading...
4 results
Search Results
Now showing 1 - 4 of 4
- Using roles to model crosscutting concernsPublication . Barbosa, F.S.; Aguiar, AdemarIn object oriented languages the problem of crosscutting concerns, due to limitations in the composition mechanisms, is recurrent. In order to reduce this problem we propose to use roles as a way of composing classes that extends the Object Oriented approach and can be used to model crosscutting concerns. To support our approach we developed a role language that extends Java, while being compatible with existing virtual machines. As validation we conducted a case study using three open source systems. We identified crosscutting concerns in the systems and then modeled them using our role approach. Results show that roles are a viable option for modeling crosscutting concerns.
- Roles as modular units of compositionPublication . Barbosa, F.S.; Aguiar, AdemarObject oriented decomposition is the most successful decomposition strategy used nowadays. But a single decomposition strategy cannot capture all aspects of a concept. Roles have been successfully used to model the different views a concept may provide but, despite this, roles have not been used as building blocks. Roles are mostly used to extend objects at runtime. In this paper we propose roles as a way to compose classes that provides a modular way of capturing and reusing those aspects that fall outside a concept’s main purpose, while being close to the OO approach. We present how roles can be made modular and reusable. We also show how we can use roles to compose classes using JavaStage, a java extension that support roles To validate our approach we developed generic and reusable roles for the Gang of Four patterns. We were able to develop reusable roles for 10 out of 23 patterns, which is a good outcome.
- Reusable roles, a test with patternsPublication . Barbosa, F.S.; Aguiar, AdemarAlthough roles have been around for a long time they have not yet reached mainstream programming languages. The variety of existing role models may be a limiting factor. We believe that for roles to be widely accepted they must enhance code reuse. An outcome would be a library of roles. We present and discuss what we feel are the characteristics that a role model must have to enable reusable and player independent roles. In this paper we present our role model and JavaStage, a role language that extends Java, with examples of reusable roles. Finally, we present our steps towards the building of a role library, by presenting the roles developed from the analysis of the GoF Design Patterns. The results obtained, we developed roles for 10 of the 23 GoF patterns, are promising.
- Composing classes: roles vs traitsPublication . Barbosa, F.S.; Aguiar, AdemarCode 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.