2 BACKGROUND
Almost all web applications are implemented based
on MVC architecture nowadays. Therefore it is rea-
sonable to implement RIAs based on the same archi-
tecture. In this section, we firstly explain MVC ar-
chitecture in Flex. Then, we describe dependencies
among modules in Flex applications.
Figure 1: MVC architecture in Flex.
2.1 Flex Programming Model and MVC
Flex applications works by event-driven architecture.
Therefore developers have to prepare event handlers
and associate them with events dispatched from visi-
ble components. As shown in Figure 1, in general, it
is reasonable to prepare a class called Handler that in-
cludes handler methods and correspond to an MXML
that includes visible components. In the context of
MVC architecture, as shown in Figure 1, MXML cor-
responds to View and Handler corresponds to Con-
troller. In a handler method, developers implement
business logics and create Model in order to reflect
the result to MXML. In addition, it is recommended
to prepare classes independent from this architecture
and delegate business logics to them (we call these
classes as Logic).
On the other hand, the triggers to start and stop an-
imations embedded in a Flash component can be right
before and after event handling. Consequently, we
start and stop an embedded animation at the beggin-
ing and at the end of the handler method by invoking
methods as Figure 2(a)-(i) and (iii). In addition, we
also delegate business logics to another class by creat-
ing an instance and invoking a method in Figure2(a)-
(ii).
2.2 Dependencies among Modules
It is also reasonable to assign developers and de-
signers to each module for efficient RIA develop-
ment; however dependencies among modules still
make it inefficient and difficult. For example, design-
ers mainly create MXML files for the design of an ap-
Figure 2: Pieces of code as cross-cutting concerns.
plication and developers have to modify the MXML
files to make associations between events and event
handlers. Likewise, designers may modify event han-
dlers implemented by developers to manage anima-
tions as shown in Figure 2(a).
Besides, there will be more complicated depen-
dencies between Handler and Logic. As we described
in section 2.1, Logic is usually introduced for in-
dependent processes, especially RPCs, from specific
architectures. As well as other components, RPC
components adopt event-driven architecture. That
is, when developers leverage RPC components, they
have to prepare event handlers and add them to the
RPC components. The handlers will be invoked by
RPC components to notify the result of operations. If
developers try to delegate a task to Logic that lever-
ages RPCs, they have to prepare a callback method to
create/modify Model that reflect the result of the task
because the task is processed asynchronously. More-
over, if developers or designers try to apply an anima-
tion for the task, they have to specify method invoca-
tions for the animation in different methods as shown
in Figure 2(b)-(i) and (ii).
3 SYSTEM IMPLEMENTATION
In AspectFX, we consider events in Flex as JoinPoint
and leverage name based conventionsas Pointcut. Be-
sides, we also consider event handlers and methods
to manage animations as Advice. AspectFX prepares
two advice types such as “beforeAdvice” and “after-
Advice” to manage animations. These advice types
need to be embedded in animated obejects as meth-
ASPECTFX - A Framework for Supporting Collaborative Works in RIA by Aspect Oriented Approach
399