27.03.2014 Views

SEKE 2012 Proceedings - Knowledge Systems Institute

SEKE 2012 Proceedings - Knowledge Systems Institute

SEKE 2012 Proceedings - Knowledge Systems Institute

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The remainder of this paper is organized as follow. Section<br />

2 presents some considerations about Aspect-Oriented<br />

programs and also some related works. Section 3 presents<br />

some considerations about the developed tool to apply the<br />

proposed visual mapping and its architecture. Section 4<br />

presents some applications of the proposed approach. Finally,<br />

the final remarks and future works are presented in<br />

Conclusions section.<br />

2 Background<br />

Kiczales et al. [14] argue that Object-Oriented Programming<br />

(OOP) is a technology that can aid Software Engineering,<br />

because the underlying object model provides a<br />

better fit to real domain problems. But they pointed out<br />

programming problems. For instance, OOP techniques are<br />

not sufficient to clearly capture important design decisions<br />

about different concerns implemented in a software system<br />

– some requirements (usually non-functional) cannot be<br />

clearly mapped to isolated units of implementation. Mechanisms<br />

to persist objects in relational data bases and security<br />

issues are examples of those concerns, usually named crosscutting<br />

concerns, because they tend to cut across multiple<br />

units of implementation [8].<br />

Aspect-Oriented Programming (AOP) tackles the crosscutting<br />

concerns problem supporting the definition of implementation<br />

units (aspects) that cut across the system units<br />

(base code), composing the expected behavior [14]. An<br />

AOP language must define elements in order to combine<br />

functional and non-functional code (aspects and base code).<br />

Such elements establish a model to define points in the base<br />

code where additional behavior may be defined (pointcuts);<br />

a mechanism to identify these points (join points); encapsulation<br />

units for these points specifications and behavior<br />

enhancements (aspects); and a process to combine aspects<br />

with the base code (weaver)[8].<br />

Functional requirements (like business rules) are coded<br />

inside a component language (e.g., Java) and non-functional<br />

requirements (e.g., logging, persistence, connection and<br />

transaction routines) are coded inside aspects. The weaver<br />

process joins the component language code with the aspects<br />

code, resulting in a runnable program. The language employed<br />

as case study in this paper is the AspectJ, which is<br />

an extension of Java language to support AOP.<br />

An Aspect-Oriented program was used for this paper<br />

to generate views. It was designed and coded using AspectJ<br />

[16] and represents an on-line music store simulation,<br />

in which a billing service observes song-play events to bill<br />

the customer. An aspect implementation of the Observer<br />

design pattern [11] was used to add billing and statistics.<br />

Additionally, aspects track plays and lyric-shows events<br />

were coded to charge the customer appropriately and to update<br />

a list of the most frequently played songs.<br />

One may observe the statical relations among aspects<br />

and classes, but it is not possible to conclude how Aspects<br />

crosscut a base code. Their relationships are important<br />

elements to Program Comprehension and should<br />

be mapped into visual structures to improve the cognitive<br />

process, which motivated extending Software Visualization<br />

techniques to deal with such elements.<br />

After weaving and compilation processes of an AspectJ<br />

program, specific structures of an Aspect-Oriented program<br />

are tangled and spread in the bytecode. However, compilers<br />

use marks about aspects and their advices that can be retrieved<br />

by analyzing their signatures. The AspectJ compiler<br />

stores its components’ signatures with specific markups,<br />

making it possible to obtain and to organize data about a<br />

compiled AspectJ program to a visual exploration.<br />

2.1 Related Works<br />

In Aspect Programs some interesting program elements<br />

can be highlighted by a Software Visualization tool in certain<br />

visual scenarios, such as, aspects, advices and pointcuts.<br />

It allows viewing how an aspect crosscuts one or more<br />

program structures, how much a program structure is modified<br />

by one or more aspects, the resulting tangled and spread<br />

code after the weaving process.<br />

A TreeMap extension was proposed to show advised relations<br />

of Aspect-Oriented programs [18], but it consists in<br />

an user-based mining task by searching regular expressions<br />

representing aspects and classes elements. Another tool,<br />

AspectJ Development Toolkit (an Eclipse toolkit for AOP),<br />

has the AJDT Visualizer [5]–aBars and Stripes visual representation<br />

of classes and aspects, highlighting its affected<br />

lines by aspects – but no visualization about how an aspect<br />

produces specified behavior in a class or other aspect.<br />

SourceMiner [4] can be used to enhance concern modularization<br />

analysis, but the concerns (focusing in AOP) need to<br />

be manually mapped. Another visualization tool, named<br />

AspectMap [9], shows implicit invocations in the source<br />

code. It allows visualizing join points shadows where aspects<br />

are specified to execute, showing the advice type and<br />

specified precedence information for a given join point.<br />

In the next section we describe the coordination model<br />

proposed, the software visualization tool that implements<br />

such a model and its architecture, and how the visual mapping<br />

is performed.<br />

3 The Software Visualization Tool<br />

In this paper we propose a software visualization tool,<br />

called SoftV iz OAH , which employs a coordinated multiple<br />

views (CMV) approach to visualize Aspect-Oriented<br />

programs. The CMV schema is depicted in Figure 1. In<br />

169

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!