2 Aspect-based Implementation of Use Cases
Aspect-based approaches provide a more advanced means for modeling features
through the concept of separation of concerns. The separation of concern is estab-
lished by modularizing the crosscutting concerns (variabilities) as a separate software
artifact called aspects. This mechanism clearly separates the distinction between
communality and variability (concern) thus supporting evolution, reusability, improv-
ing traceability and enabling consistency checking [1]. The separation of concerns
can be realized using the Aspect-Oriented Programming (AOP) where each concerns
can be modeled as aspects [5].
The use case is a common modeling practice. Use case is a technique to capture the
system functionality and requirements using the UML [4]. According to Jacobson and
Ng [3] the implementation of use cases using the traditional object oriented languages
and technique typically breaks the modularity of use case. When the use cases are
implemented using an Object-Oriented languages they may lose their modularity as
the resultant code could be scattered and tangled across different modules [4]. Thus in
[3] Jacobson and Ng have proposed a aspect-based modeling of use case or use case
slice, which are modularized units of the use case.
A use case slice can be modeled as a special kind of package stereotyped as <<use
case slice>> consisting of a collaboration (UML diagram describing the realization of
a use case (interaction, class etc.)), specific classes; which are specific to a use case
realization or commonality or base code, and specific extensions or aspect; extensions
to existing classes specific to a use case realization or concerns or variabilities [4]. In
this paper we will be assuming that a use case slice will have a name, a collaboration
symbol (a dashed ellipse), the base class (specific classes) and concern (specific ex-
tension). The concern in the use case slice has two specific compartments, one for
listing the pointcuts and the other to list the advices. In the next section we will picto-
rially show how a use case slice implementation of a particular product line feature in
our EPL looks like.
According to Lopez and Batory in [4] use case slices do not provide modeling
support for the variability or concerns entailed by a product line. Thus a use case
diagram conveys the design of a single member of a product line. The drawbacks
observed by them are:
1. The use case slices lack a clear composition model to map use case models to
concrete working implementations.
2. The translation of the use case slices to the source code in AspectJ highlights the
missing of an important compositional issue, precedence management.
3. The concern’s (specific extensions) being specific to a use case slice inhibits its
reuse. This can be mitigated by keeping the concerns not so specific to a use case
slice.
4. A single use case is not limited to have a single concern (pointcut and advice) and
so a single use case slice can have multiple concerns [3]. For example, if multiple
advices are superimposed at the same joinpoint then there is no way to assign an
ordering on the composition of these advices at a given joinpoint. In short the
composition mechanism for the aspect-based implementation of use case slices
has to address issues related to precedence management.
142