2.1 Aspect-oriented Programming
The principle of separation of concerns (Parnas,
1972) refers to the realization of system concepts into
separate software units and it is a fundamental prin-
ciple to software development. The associated bene-
fits include better analysis and understanding of sys-
tems, high readability of modular code, high level
of reuse, easy adaptability and good maintainability.
Despite the success of object-orientation in the ef-
fort to achieve separation of concerns, certain prop-
erties cannot be directly mapped in a one-to-one fash-
ion from the problem domain to the solution space,
and thus cannot be localized in single modular units.
Their implementation ends up cutting across the in-
heritance hierarchy of the system. Crosscutting con-
cerns (or “aspects”) include persistence, authentica-
tion, synchronization and logging. The “crosscutting
phenomenon” creates two implications: 1) the scatter-
ing of concerns over a number of modular units and 2)
the tangling of code in modular units. As a result, de-
velopers are faced with a number of problems includ-
ing a low level of cohesion of modular units, strong
coupling between modular units and difficult compre-
hensibility, resulting in programs that are more error
prone.
Aspect-Oriented Programming (AOP) (Kiczales
et al., 1997; Elrad et al., 2001) explicitly addresses
those concerns which “can not be cleanly encapsu-
lated in a generalized procedure (i.e. object, method,
procedure, API)” (Kiczales et al., 1997) by introduc-
ing the notion of an aspect definition, which is a mod-
ular unit of decomposition. There is currently a grow-
ing number of approaches and technologies to support
AOP. One notable technology is AspectJ (Kiczales
et al., 2001), a general-purpose aspect-oriented exten-
sion to the Java language, which has influenced the
design dimensions of several other general-purpose
aspect-oriented languages, and has provided the com-
munity with a common vocabulary based on its own
linguistic constructs. In the AspectJ model, an as-
pect definition is a new unit of modularity provid-
ing behavior to be inserted over functional compo-
nents. This behavior is defined in method-like blocks
called advice blocks. However, unlike a method, an
advice block is never explicitly called. Instead, it is
activated by an associated construct called a point-
cut expression. A pointcut expression is a predicate
over well-defined points in the execution of the pro-
gram which are referred to as join points. When the
program execution reaches a join point captured by
a pointcut expression, the associated advice block is
executed. Even though the specification and level of
granularity of the join point model differ from one
language to another, common join points in current
aspect-oriented language specifications include calls
to methods and constructors as well as executions of
methods and constructors. Most aspect-oriented lan-
guages provide a level of granularity which specifies
exactly when an advice block should be executed,
such as executing before, after, or instead of the code
defined at the associated pointcut. Furthermore, much
like a class, an aspect definition may contain state and
behavior. It is also important to note that AOP is nei-
ther limited to object-oriented programming (OOP)
nor to the imperative programming paradigm. How-
ever, we will restrict this discussion to the context of
object-orientation.
2.2 Production Rules and Derivation
Sentences Over Uml Semantics
A formal description of semantics is essentially a
means to represent knowledge. We can represent
knowledge in a form that indicates the ways in which
the knowledge can be used. More precisely, each
item of knowledge can be represented by a rule which
specifies when to use it and how to use it. Such a
rule takes the form “When a condition of type C oc-
curs, execute action A.” A rule of this kind is called a
production and a system which represents knowledge
as a set of productions is called a production system.
A sequence of rule applications is called a derivation
and the result of this process is called a derivation
sentence (Aho et al., 1986).
With UML we are able to model and visualize a
real world system based on object definitions and ob-
ject relationships. The semantics and metadata be-
hind the model can be represented as a set of abstract
rules, which can be production rules. By definition,
production rules must be finite, implying that in or-
der to represent the semantics of UML artifacts we
need a limited number of production rules. As a con-
sequence, our knowledge, as incorporated in the pro-
duction rules, must also be finite. It is the process
of using this knowledge that will be “productive.” In
effect, production rules can define an infinite set of
scenarios. Derivation sentences can be deployed over
these production rules for representing a scenario.
In (Foumani and Constantinides, 2005a) and
(Foumani and Constantinides, 2005b) we presented
a set of production rules to represent the semantics
behind UML artifacts, where the static model is rep-
resented by a class diagram and the dynamic model
is represented by a set of interaction diagrams. More
specifically, the semantics of object-oriented artifacts,
G
, can be defined in terms of a set of five elements,
each of which is finite. Let
G =
{
C, A, M, P, R
},
DETECTING ASPECTUAL BEHAVIOR IN UML INTERACTION DIAGRAMS
379