Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Department of Informatics, Faculty of Sciences, University of Lisbon, Campo Grande, 1749-016 Lisboa, Portugal
Department of Software Systems, Tampere University of Technology, P.O. Box 553, FIN-33101 Tampere, Finland
a r t i c l e
i n f o
Article history:
Received 10 February 2009
Received in revised form 31 August 2009
Accepted 27 January 2010
Available online 4 February 2010
Keywords:
Domain-specic modeling
Object-oriented frameworks
Software product-lines
Aspect-oriented programming
a b s t r a c t
The extension of frameworks with domain-specic modeling languages (DSML) has proved to be an effective way of improving the productivity in software product-line engineering. However, developing and
evolving a DSML is typically a difcult and time-consuming task because it requires to develop and maintain a code generator, which transforms application models into framework-based code. In this paper, we
propose a new approach for extending object-oriented frameworks that aims to alleviate this problem.
The approach is based on developing an additional aspect-oriented layer that encodes a DSML for building framework-based applications, eliminating the need of implementing a code generator. We further
show how a language workbench is capable of automating the construction of DSMLs using the proposed
layer.
2010 Elsevier Inc. All rights reserved.
1. Introduction
Object-oriented frameworks are an important means for
realizing software product-lines (Bosch, 2000) as they allow partial
design and implementation solutions to be dened for families of
applications. In this situation, the individual software products of
the product-line are developed by instantiating the corresponding
framework. The activities related to developing a framework are
known as domain engineering, whereas application engineering
refers to the development of individual, framework-based
applications.
Learning how to correctly use a non-trivial framework is a
difcult and time-consuming activity (Moser and Nierstrasz,
1996). The situation is even worse if the framework changes
regularly, as happens in the case of frameworks for software product-lines. An effective way of facilitating the task of application
engineers is to provide them with a domain-specic modeling
(DSM) solution for the framework (Kelly and Tolvanen, 2008). The
conventional way of realizing a DSM solution involves the development of (i) a domain-specic modeling language (DSML) that
captures the conceptual variability of the family of applications that
can be built with the framework, and (ii) a code generator for
generating full working framework-based applications from the
models. We refer to such realizations of DSM as conventional
approaches.
* Corresponding author. Tel./fax: +351 912483944.
E-mail addresses: andre.santos@di.fc.ul.pt (A.L. Santos), kai.koskimies@tut. (K.
Koskimies), mal@di.fc.ul.pt (A. Lopes).
0164-1212/$ - see front matter 2010 Elsevier Inc. All rights reserved.
doi:10.1016/j.jss.2010.01.047
1079
A.L. Santos et al. / The Journal of Systems and Software 83 (2010) 10781093
problem domain
solution domain
Meta-model
OO
Framework
instance of
instantiates
Application
Model
Code
Generator
Application
Code
work-based applications, without the need of having a code generator. In this way, domain engineers are relieved of the maintenance
problems that are typically associated to the development of code
generators.
The paper proceeds as follows. Section 2 presents an overview
of our approach. Section 3 explains how conventional framework
hot-spots can be represented in a modular way in terms of specialization aspects. Section 4 addresses the development of the DSM
layer using specialization aspects. Section 5 explains how DSMLs
can be automatically derived from DSM layers. Section 6 presents
the ALFAMA tool. Section 7 compares the proposed approach with
conventional approaches for DSM. Section 8 describes the case
study on eclipse RCP. Section 9 discusses related work, and Section
10 concludes the paper.
2. Approach overview
This section presents an overview of our approach (see Fig. 2).
The approach relies on a language workbench that automates the
DSML construction and usage at the expense of some new development activities. The following summarizes the role of the different
elements involved in the process of developing the DSM solutions
using our approach, making a comparison with the conventional
approach (depicted in Fig. 1):
Domain engineers. Domain engineers have to develop a DSM
layer in addition to the framework, while they are relieved of
both implementing a code generator and dening the DSML
concepts separately (i.e. externally to the framework
implementation).
Language workbench. The language workbench extracts the
meta-model that denes the DSML from the DSM layer. Additionally, it is able to transform application models into code
based on the DSM layer. The language workbench is generic,
in the sense that it can be used for multiple frameworks, as long
as the DSM layers are developed in the supported programming
language (in this work, AspectJ for Java frameworks).
Application engineers. Application models are developed by
application engineers as if a conventional approach was being
used. Although the generated code is based on the DSM layer
instead of directly on the framework, application models are
developed in the same way.
The DSM layer includes a formal representation of the metamodel embedded in its modules, using modeling constructs that
are equivalent in terms of expressiveness to those that can be
found in existing meta-modeling technologies (MetaCase, 2008;
Greeneld and Short, 2005; Eclipse Foundation, 2009). When
implementing the ALFAMA prototype as a proof-of-concept of
the proposed language workbench, our option was to consider
the modeling constructs that are available in EMF (Eclipse Foundation, 2009). EMF is a Java implementation of the meta-object facility (MOF) (OMG, 2002), a standard for dening modeling
problem domain
Meta-model
solution domain
extractor
Language
Workbench
instance of
Application
Model
generator
DSM
Layer
OO
Framework
instantiates
Application
Code
1080
A.L. Santos et al. / The Journal of Systems and Software 83 (2010) 10781093
languages. Despite some small differences, the meta-models dened in EMF have equivalent expressiveness to those that can be
dened using commercial tools such as MetaEdit+ (MetaCase,
2008) and Microsoft DSL Tools (Greeneld and Short, 2005). Representing the DSML in an external format using a meta-modeling
technology such as EMF eases the integration with other tools
and makes possible to use the available serialization infrastructure
for meta-models and models.
3. Framework specialization aspects
The conventional development of framework-based applications takes place at certain extension points called hot-spots (Pree,
1995), which can be adapted for implementing application-specic
features. Hot-spots usually involve several classes and it is common that a single class participates in several hot-spots. In Santos
et al. (2007) we relate this characteristic with the phenomena of
scattering and tangling. Specialization aspects were proposed in
order to support the representation of hot-spots in a modular
way, enabling to untangle and de-scatter the adaptation of hotspots in framework-based applications.
In this section we present the essentials of specialization aspects and explain the advantages of using them in the context of
the approach presented in this paper. The next subsection presents
an elementary framework to be used in the following subsections
as a running example. Section 3.2 explains the concept of specialization aspects. The remaining subsections illustrate how the different mechanisms for instantiating object-oriented frameworks
can be captured with specialization aspects, and how to implement
them in AspectJ (Eclipse Foundation, 2009).
3.1. Conventional hot-spot adaptation
Conventionally, the adaptation of a hot-spot in a frameworkbased application involves different adaptation mechanisms. For
instance, the adaptation of a certain hot-spot may require to extend a class and override a hook method, while another hot-spot
may require to compose a parameterized object with another object exposed by the framework.
Hook method overriding and object composition are the two elementary mechanisms of hot-spot adaptation (Pree, 1999). Inheritance is a common adaptation mechanism in frameworks, and
solutions that apply the template method pattern (Gamma et al.,
1995) occur very often. These cases require application classes to
inherit from a framework class, which is typically abstract, and
to override hook methods.
As an example, consider a framework with the classes BaseClass,
Item, and SubItem (see Fig. 3a). The class BaseClass provides a functionality (not shown for ease of presentation) that is optional, i.e.
application engineers may choose if they want to include it in their
applications (hot-spot H1). In addition, this class offers a hook
method hook(..) that serves the purpose of plugging an arbitrary
number of objects of type Item into the framework (hot-spot H2).
In order to make the example richer and more interesting, also assume that, in the framework at hand, correct adaptation of the hotspot H2 is conned to the plugging of objects of type Item created
for that purpose, with application-specic names. The class Item
denes that a name is required for the construction of a new item,
while it offers a method addRelation(..) that supports the addition of
a relationship between two items (hot-spot H3). Finally, the class
SubItem is a specialization of Item where no name has to be given.
By using the framework in the conventional way, an application
engineer that wishes to have the functionality provided by BaseClass in its application has to dene a subclass of BaseClass (H1).
If the application does not require the plugging of objects, then
A.L. Santos et al. / The Journal of Systems and Software 83 (2010) 10781093
BaseClass
1081
base
framework
Item
SubItem
specialization
aspects
Item
Aspect
Relation
Aspect
SubItem
Aspect
ItemB
Conventional
Application
Class
Application
Class
conventional
RelationA2B
ItemA
application aspects
Fig. 4 illustrates a layer of specialization aspects for the framework given in the previous subsection. We can see a set of specialization aspects forming an additional layer on top of the
framework (ItemAspect, SubItemAspect, and RelationAspect). The bottom part of the gure depticts the two alternative ways of dening
the same framework-based application: (i) on the left-hand side,
we can see the class ConventionalApplicationClass presented in the
previous subsection, (ii) on the right-hand side, we can see the
class ApplicationClass plus the application aspects (ItemA, ItemB,
and RelationA2B), which implement the application using the layer
of specialization aspects. Each application aspect implements a single concept instantiation in the application. Moreover, the relation
between items can also be modularized. As we shall see in Section
4, this capability of having a concept-oriented modularization is an
advantage with respect to the transformation of application models into framework-based code.
The following subsections will gradually introduce the implementation of both the specialization aspects and the application
aspects shown in Fig. 4 (in gray). In each situation, a specialization
aspect that wraps the conventional hot-spot is presented, as well
as an example of a concrete adaptation achieved through the definition of an application aspect.
3.3. Capturing hook method overriding
When having hot-spots based on hook method overriding, the
solution using specialization aspects consists of having a separate
abstract aspect that lls in the behavior of hook methods, so that
the hot-spot can be adapted in a compositional way.
In the case of the running example, the choice of having the
base functionality provided by BaseClass (hot-spot H1) in an application is always captured through the denition of an empty
extension of the BaseClass, as shown in Fig. 5.
The choice of plugging one or more items in the framework is
achieved through the denition of application aspects that instantiate the specialization aspect presented in Fig. 6a, which wraps
hot-spot H2. The specialization aspect ItemAspect is parameterized with a name (lines 46) and includes an abstract pointcut app-
1082
A.L. Santos et al. / The Journal of Systems and Software 83 (2010) 10781093
application aspects that plug the source and target object, respectively. The advice related to sourceObj() captures the instantiation
of the Item object that is returned by create(), and assigns the variable sourceItem pointing to it (line 11). The advice related to targetObj() is analogous, but assigns the variable targetItem with the
target object instead. The fact that the specialization aspect does
not know which Item object is created rst, requires the conditional
invocation of addRelation(..) (lines 1213, 2324). However, addRelation() is executed only once given that there is a single invocation
of create() per application aspect.
Fig. 8b presents the application aspect RelationA2B, which composes the objects plugged by the application aspects ItemA and
ItemB (both introduced previously), establishing the relation between the items.
The described mechanism enables object compositions to be
modularized. In this way, one can implement a composition of objects, which are handled by other application aspects, without
knowing where and how the objects are instantiated. Such compositions are increments that do not require the inspection of the participating application aspects. When using conventional hot-spot
adaptation it is not possible to achieve this kind of modularity. Further on we shall see that the modularization of relationships os
advantageous with respect to the transformation of application
models into framework-based code.
4. DSM layer
This section addresses the development of the DSM layer. A
DSM layer is framework-specic and it is developed by domain
engineers. The DSM layer is composed of several annotated specialization aspects, which are referred to as DSM modules. While
the specialization aspects are capable of modularizing the adapta-
1083
A.L. Santos et al. / The Journal of Systems and Software 83 (2010) 10781093
<<accesible>>
0..1
Attribute
name
primitive type
Abstract
Concept
Concept
super name
1
Table
<<abstract>>
Relationship
multiplicity
* ...
target
Open
Concept
Accessible
Concept
Composite
Association
Directed
Association
RCPApplication
width
height
name
<<abstract>>
<<open>>
m1:Menu
name="M1"
Action
MenuAction
access
* Menu
OpenAction
ExitAction
a1:MenuAction
r:RCPApplication
width=400
height=200
e:ExitAction
...
action()
o:OpenAction
t:Table
<<accesses>>
Fig. 10. Example framework: meta-model (left) and application model (right).
framework (McAffer and Lemieux, 2005). This case study is discussed in detail in Section 8. Through the rest of the paper, we shall
use just a small simplied fragment of the eclipse RCP framework
as a running example.
The framework-provided concepts that will be used in the DSM
layer are dened in the meta-model given as a class diagram in the
left-hand part of Fig. 10. The meta-model exemplies each of the
modeling constructs given in Fig. 9. Each class represents a concept. An RCP application has initial window size given by width
and height. It may contain several actions (abstract concept) and
several menus. These two containment relations are examples of
composite associations. The specic behaviour of an action can
be dened in terms of the operation action(). An open action is an
open concept where the action behavior can be given manually.
An exit action is a framework-provided action for quiting the application, which can be used by the application engineers as-is. The
two previous cases are examples of concept inheritance. A menu
has a name and may contain menu actions which contain references
to the applications actions. This is an example of a directed association. An RCP application may indirectly contain tables, which
are children of other child concepts (not shown). A table can be accessed by open concepts, and thus, it is an accessible concept.
On the right-hand side of Fig. 10 we can see an object diagram
representing an example instance of the meta-model (i.e. an application model). It describes an RCP application with width equals to
400 and height equals to 200. The application has two actions, the
exit action, and an open action that accesses the table. It also has a
menu M1 with a menu action that executes the exit action.
Both the meta-model and the application model are used
throughout the next subsection. The former is what is to be expressed in the DSM layer, while the latter is used for exemplifying
the code generation.
4.3. DSM modules
This subsection explains how to implement the DSM modules
making use of the different modeling constructs described in
Fig. 9. A DSM module is a specialization aspect with additional annotations on its elements, namely on module declaration, constructor
signature, and pointcuts. In what follows, each modeling construct is
illustrated with an example presented in a gure with three parts:
The upper part shows the code of a DSM module, written in Java/
AspectJ, plus annotations. The code examples omit irrelevant
details. Detailed issues concerning AspectJs primitives are
explained only briey.
1084
A.L. Santos et al. / The Journal of Systems and Software 83 (2010) 10781093
A.L. Santos et al. / The Journal of Systems and Software 83 (2010) 10781093
1085
Fig. 13. DSM module dening an abstract concept and DSM module inheriting from
it.
The gure also presents the DSM module for handling the concept
exit action (ExitAction), which inherits from Action, overriding createAction() and leaving the inherited abstract pointcut application()
undened.
In the bottom part of Fig. 13 we can see the code generated by
the language workbench for the object e. The mapping is analogous
to the previous cases.
4.3.4. Directed associations
A concept may declare a directed association with another concept. This can be done by annotating an abstract pointcut with
@Association, with parameters concept and mult, as in composite
associations.
Fig. 14 presents the DSM module that handles the concept menu
action. An extension of Action is to be dened in the pointcut action(). The rst advice captures the action creation and keeps its reference. An extension of Menu is to be dened in the pointcut
menu(), in order to set the menu which contains the menu action.
The second advice adds the action upon the creation of the menu.
In the bottom part of Fig. 14 we can see the code generated by
the language workbench for the object ma1. The mapping of the
child-parent link between ma1 and m1 is analogous to the previous
cases, given that ma1 is a child of m1. Therefore, the pointcut
menu() is dened on the module M1. On the other hand, the link between ma1 and e is mapped to the denition of the pointcut action() on E, given that this link pertains to a directed association.
Recall that in the case of directed associations it is the owner object
that denes the relationship to a target object.
1086
A.L. Santos et al. / The Journal of Systems and Software 83 (2010) 10781093
meta-meta-model
(technology)
<<instance>>
common meta-model
<<extends>>
meta-model
domain
engineering
application
engineering
OO Framework
Language Workbench
<<extends>>
Meta-model
Extractor
DSM Layer
<<instance>>
<<instance>>
application model
Code
Generator
Application
A.L. Santos et al. / The Journal of Systems and Software 83 (2010) 10781093
1087
<<abstract>>
Concept
<<abstract>>
<<abstract>>
AccessibleConcept
OpenConcept
RCPApplication
width
height
name
target
Access
<<abstract>>
Action
Table
* Menu
MenuAction
...
OpenAction
ExitAction
action()
Fig. 17. Common meta-model (in gray) which is extended by all the meta-models,
and the example meta-model of Section 4 extending it (in white).
Fig. 18. Algorithm for obtaining a meta-model from the DSM layer.
6. ALFAMA tool
We have implemented a tool named ALFAMA (Santos, 2008) as
a proof-of-concept of the language workbench for developing
DSMLs proposed in this paper. The tool was implemented as a
set of eclipse (Eclipse Foundation, 2009) plugins, it is suitable for
DSM layers written in AspectJ (Eclipse Foundation, 2009) together
with Java 5 annotations, while it builds DSMLs making use of the
EMF technology (Eclipse Foundation, 2009). The following subsections describe the tool from the different perspectives of domain
and application engineering.
6.1. Domain engineering
Fig. 20 presents a screenshot of the ALFAMA tool from a domain
engineering perspective. The DSM layer is implemented for the
base framework using the regular programming language editors
of Java and AspectJ. On the left-hand side of the gure we can
1088
A.L. Santos et al. / The Journal of Systems and Software 83 (2010) 10781093
code is divided into two sets: public and hidden. As the names suggest, the public set contains modules that are intended to be used
externally or manipulated (open modules), whereas the hidden set
contains modules that are not meant to be seen, touched, or understood by an application engineer. Such a distinction is achieved by
generating code in different packages, as it is shown in the Package
Explorer view.
In the case of open concepts, the application developer may
navigate from the objects of the application model to the corresponding open modules, in order to complete them manually.
The application model shown in the gure has a mark on an object
of type OpenAction (open concept), which has two nested accesses
to objects of type TableViewer and TextBox. This implies the corresponding open module AddText (bottom part of the gure) to be
generated with two static attributes table and textbox. The attributes are assigned automatically and can be used directly (as in
the given implementation of action()).
6.3. Observations
Optionally, GMF (Eclipse Foundation, 2009) can be used independently for developing a concrete syntax for the DSML. Although
the concrete syntax of DSMLs is an important issue from a users
perspective, its denition is out of the scope of this paper. The
ALFAMA tool supports a generic tree-based representation of application models with no domain-specic (graphical) notations
excepting the icons of the tree nodes. Fig. 21 illustrated such
tree-based representation of application models. Concrete graphical syntax is an orthogonal issue that can be handled independently from abstract syntax and semantics, and hence, it does
not interfere with the necessary components for generating framework-based applications.
Fig. 19. Algorithm for generating application code based on the DSM layer from an
application model.
7.1. Advantages
Reduces complexity and improves understandability. A code generator is a program that generates another program. In non-trivial
cases, this indirection is a source of complexity that may cause a
burden for domain engineers. The most structured and intuitive
approach to the development of code generators is to use code
templates. Still, the implementation of the code generator can easily become complex, for instance, when parts of generated code
that result from different model elements are interleaved in common modules and/or have to share instance variables. In our approach, the DSML is encoded in the DSM layer, using a relatively
small set of mechanisms based on advices that either complete
hook methods or compose objects. As illustrated in the examples
of Section 4, the same aspect-oriented mechanisms are used
repeatedly. The adoption of abstract concepts (e.g. Action in Section
4.3.3) in the DSM layer allows increments to be included in the
DSML without difculty and at a very low cost. Consider for instance the extensions of Action. One could add another action just
by coding a simple extension, without the need of understanding
anything about how the actions are plugged in the framework.
The DSML can thus be augmented at these points even by developers that do not master the framework. Just by adding the small
module, the new feature becomes ready to use in the DSML.
Ensures consistency. When using conventional approaches, the
consistency between the framework, the modeling language, and
A.L. Santos et al. / The Journal of Systems and Software 83 (2010) 10781093
1089
the code generator, can be easily broken. A code generator produces text, which is code that instantiates the framework. This
code is not checked against compilation until the generator is
tested with sample inputs. This brings consistency problems, since
a change in the framework may introduce unnoticeable errors in
the code that is produced by a not up-to-date generator. Consider
the hook method llMenuBar(..) of Application of the example framework. If, for instance, this method changes its signature, a code
generator programmed for overriding the former version of the
hook method would not manifest its inconsistency with respect
to the framework. The inconsistency would only be noticed when
generating code from an application model that involves the hook
method. More concretely, the error would be noticed during the
compilation of the generated code. In contrast, in our approach, if
a module denes an advice that is acting over a non-existent method, one gets a compile-time warning that informs that the module
is broken. Nevertheless, compilation errors also occur if the body of
an advice is using inexistent framework elements.
Promotes composability and contributes to low change impact. In
general, code generators are not implemented in cohesive and
composable modules. This implies that adding increments to the
1090
A.L. Santos et al. / The Journal of Systems and Software 83 (2010) 10781093
programming paradigm. However, in order to overcome such a difculty, our work in Santos and Koskimies (2008) presents a set of
design patterns that provide a good aid for developing specialization aspects for a DSM layer. Moreover, the use of aspects to manage variability has been applied successfully in another approach
(Kulesza et al., 2006a), reinforcing our belief that aspects are useful
when combined with frameworks.
Uniform representation of modeling constructs. The mechanisms
to represent the meta-model elements in the DSM layer are not
very exible. Each modeling construct has a single way of being
represented. For instance, a meta-class (i.e. concept) must be represented in a module and the attributes must be represented in a
constructor of that module. Although different ways to represent
the same modeling construct could be contemplated, we found
no practical signicance in doing so. Moreover, having such different ways would compromise simplicity. Perhaps when trying the
approach on more frameworks this option could be revised, in case
DSM modules are found inelegant. In conventional DSM
approaches, meta-classes, attributes, etc, can be mapped freely,
in a sense that it is up to domain engineers to decide how to
map modeling elements to implementation elements. Therefore,
the automation gains of our approach compromise exibility to a
certain extent.
Generation of other artifacts. Some frameworks require applications to provide descriptors (e.g. in XML) in addition to code. The
information contained in those descriptors can also be represented
in the DSML. Currently, our approach does not address the mapping of DSML concepts to different artifacts other than the framework instantiation code. However, given that the DSML is dened
independently in a standard format, there is no obstacle in having a
separate generator that processes the same applications models
with the purpose of generating other artifacts.
Fine-grained constraints on application models. A DSM layer denes the meta-model of a DSML. Such a meta-model is a conceptual model comprising concepts with attributes, abstract
concepts, concept inheritance, composite and directed associations. Although the modeling constructs are fairly rich, detailed domain rules may require more expressive means to enforce them.
Such ne-grained constraints can be specied on top of the conceptual model using an additional language, such as the object
constraint language (OCL) (OMG, 2003). So far, in our approach
we have not yet addressed the specication of such constraints
within the DSM modules.
8. Case study
The proposed approach for developing the DSM layer went
through an iterative process where its applicability was checked
against two case study frameworks, JHotDraw (SourceForge,
2008) and Eclipse RCP (McAffer and Lemieux, 2005). The purpose
of these case studies was twofold. On the one hand, they were a
1091
A.L. Santos et al. / The Journal of Systems and Software 83 (2010) 10781093
menu
Table 1
LOC for Eclipse RCP concepts.
RCP application
cool bar
cool bar
action
perspective
SWT widgets
button (and mouse action)
view
menu
view part
table
viewer
*
pop-up menu
menu action
Concept
J + AspJ
Concept
J + AspJ
RCPApplication
Action
ExitAction
OpenAction*
Maximize
ViewPart
Perspective
ViewPlace
Menu
MenuItem
SubMenu
Separator
MenuAction
71 + 0
14 + 7
8+0
22 + 0
8+0
24 + 15
19 + 7
22 + 19
26 + 20
6 + 13
16 + 0
7+0
9+6
CompositeElement
ControlElement
Text Box
Button
PushButton
ToggleButton
MouseAction
MouseClick
CoolBar
ToolGroup
CoolBarAction
ViewerElement
TableViewer
18 + 6
7+0
19 + 0
35 + 0
9+0
7+0
12 + 13
4+1
7+6
28 + 4
11 + 3
7+0
8+0
source to mine hot-spots and test the proposed modeling constructs for the DSM layer. On the other hand, the frameworks were
used to validate the approach by building fairly rich DSMLs using
the ALFAMA tool. This section focuses on the eclipse RCP framework, which is denitely more complex than JHotDraw and can
be considered an industrial-strength framework.
8.1. Goal
The main goal of the case study on eclipse RCP was to evaluate if
the proposed approach could be used to develop non-trivial
DSMLs. It was not our aim to evaluate the efciency of the DSMLs
in comparison with manual application development.
Eclipse RCP is a framework for building stand-alone applications based on eclipses dynamic plug-in model and UI facilities.
Fig. 22 illustrates the main framework concepts used in the case
study. Eclipse RCP by itself cannot be considered a product-line.
However, it is a platform on which product-lines can be built on
top of. Typically, a product-line would have a narrower scope, with
its own actions, view parts, and perspectives, which could be combined to obtain different products. Therefore, we consider this case
study relevant in the context of product-lines.
8.2. Results
We were capable of developing an independent DSM layer for
eclipse RCP, without having to modify or inspect the internals of
its implementation (i.e. only the interfaces had to be known).
The meta-model fragment visible in Fig. 20 corresponds to a subset
(roughly half) of the DSM modules that were developed. We were
able to handle the main application concepts, and fully executable
code could be successfully generated from the application modules. We tested the extracted DSML by developing toy applications,
which made use of the framework features covered by the
language.
In order to give an idea of the size of a DSM layer, Table 1 shows
the number of lines of code (LOC) of Java and AspectJ of the modules associated with Eclipse RCP concepts, including all the concepts that are visible in the meta-model of Fig. 20. Concepts that
inherit from other concepts are represented nested under the
super concept, and abstract concepts are in italic. The DSM layer
covering the given concepts had a total of 544 LOC, from which
approximately only one fth uses AOP/AspectJ primitives. Therefore, a big portion of these LOC is actually regular Java. Program-
1092
A.L. Santos et al. / The Journal of Systems and Software 83 (2010) 10781093
that are described in the FSML concepts. The use of a FSML supports a development paradigm where an application is obtained
by generating code that is meant to be completed manually (if
needed). Our approach does not intend to support round-trip engineering. Instead, our option was to have a clear separation between
generated and manually written code, where the former is not intended to be manipulated or understood in any case, following the
DSM philosophy of raising the abstraction level by complexity
hiding.
MetaEdit+ (MetaCase, 2008), Microsoft DSL Tools (Greeneld
and Short, 2005), and eclipse-based technologies (Eclipse Foundation, 2009), are language workbenches that may be used to develop
a DSM solution for an object-oriented framework. Each of these
language workbenches offers its own meta-modeling technology
for describing the DSML concepts and the application models.
Moreover, each language workbench offers a specic language
for developing the code generators. Although these tools are not
particularly targeted for DSMLs for object-oriented frameworks,
they offer good support for developing such DSMLs. Our approach
is by no means an alternative to existing language workbenches,
but it should rather be seen as complementary.
The core element of our strategy is the DSM layer, which is a
solution domain artifact, and therefore, it is not related to language
workbenches by itself. However, we propose the concept of a language workbench for automating the construction of DSMLs that
takes advantage of the benets of the DSM layer, namely the short
gap between application models and framework-based code. The
implementation strategy that we followed implies the proposed
language workbench to be a client of an existing language workbench, in the sense that it uses its meta-modeling technology
and environment.
Despite the fact that we have chosen eclipse-based technologies
for developing ALFAMA on top of, the language workbench that we
propose could have been developed on top of one of the other
available tools. The set of modeling constructs that we considered
in our approach (recall Fig. 9) is fairly general, in the sense that
those modeling constructs can be smoothly mapped to the modeling constructs that are supported by the available language workbenches. As we implemented the extraction of EMF meta-models
from DSM layers, we could as well for instance implement the
extraction to Microsoft DSL Tools meta-models. Analogously, the
transformation performed by the code generator component could
be implemented using another technology.
10. Conclusion
In this paper we presented a new approach for developing a
DSML for an existing object-oriented framework. The approach relies on extending frameworks with an additional layer that encodes a DSML for generating framework-based applications. We
validated the approach by implementing a prototype tool and performing a case study on the eclipse RCP framework. Our approach
is suitable for product-lines implemented as object-oriented
frameworks.
Our approach clearly dissents from the state-of-the-art in the
sense that an extended framework, i.e. the framework plus a
DSM layer, becomes a all-in-one artifact composed of the framework and its DSML. An existing framework can be wrapped with a
thin DSM layer, from which a generic language workbench performs two light-weight tasks, (i) the extraction of the DSML denition, and (ii) the transformation of application models described in
the extracted DSML into code based on the DSM layer, obtaining
executable applications.
After carrying out this research, we strongly believe that it is
possible to realize DSM solutions that rely solely on the framework
A.L. Santos et al. / The Journal of Systems and Software 83 (2010) 10781093
research projects related to software architectures, with a special emphasis on
patterns, documentation, evaluation, and synthesis. He is currently the head of
Finnish Graduate School on Software Systems and Engineering.
1093
Technical University of Lisbon and received her Ph.D. in Computer Science from the
Department of Informatics of the University of Lisbon in 1999. Her research
interests are mainly in formal models for software engineering, namely design
techniques, principles and theories that support the engineering of specic types of
software systems such as reactive systems, service-oriented systems, and selfadaptive systems.