Model Evolution with Aspectoriented Mechanisms - PowerPoint PPT Presentation

1 / 34
About This Presentation
Title:

Model Evolution with Aspectoriented Mechanisms

Description:

Shinji Sano, Yusaku Maeno, Satoshi Murakami (Kyushu ... for J2EE. Aspect library. for other platforms. Aspect library. for product-line B. Aspect library ... – PowerPoint PPT presentation

Number of Views:24
Avg rating:3.0/5.0
Slides: 35
Provided by: poslMinni
Category:

less

Transcript and Presenter's Notes

Title: Model Evolution with Aspectoriented Mechanisms


1
Model Evolution with Aspect-oriented Mechanisms
IWPSE 2005International Workshop on Principles
of Software Evolution
  • Naoyasu Ubayashi (Kyushu Institute of
    Technology)
  • Tetsuo Tamai (University of Tokyo)
  • Shinji Sano, Yusaku Maeno, Satoshi Murakami
    (Kyushu Institute of Technology)
  • 6 September 2005

2
Overview
  • Motivation
  • An extensible model compiler based on AO
  • Evolution based on extensible model compiler
  • Related work
  • Conclusion

3
1. Motivation
4
Issues to be tackled
  • Model-based development is a software development
    method in which models are created before source
    code is written.
  • Although the method is effective, we have to
    modify models when we face evolution such as
    change of platforms.
  • These modifications crosscut over many places in
    the models, and tend to cause unexpected errors.

New platforms
New requirements
Optimization
Evolution!
5
How does MDA deal with this problem ?
OOSD
MDA
CIM
Analysis
PIM
Design
model compiler
PSM
We can regard PIMs as new kinds of reusable
software components because they can be reused
even if a platform is changed.
Coding
Source code
MDA Model-Driven Architecture PIM Platform
Independent Model CIM Computation Independent
Model PSM Platform Specific Model
6
But,
Multiple concerns
  • Although MDA is effective for software
    development, it mainly focuses on
    platform-specific concerns.
  • We have to modify models when we face evolution
    related to other kinds of concerns including
    application-specific optimization, security
    policies, and deployment.
  • It is necessary to allow a modeler to customize
    transformation rules because model modifications
    for dealing with these concerns may be specific
    to an application.

Extensibility
7
Motivating example -- A simple bulletin board
system
8
Example of model evolution
Variation of Second Version
Original
First Version
Second Version
Platform concern
Optimization concern
Logging concern
logging
modifications crosscut over many places
logging
make a product that is executable on the Struts
platform
optimize memory usage
add a logging function for debugging
9
Our approach
  • We propose a method for model evolution using an
    extensible model compiler based on aspect
    orientation, a mechanism that modularizes
    crosscutting concerns.
  • Previously we proposed an AO modeling language
    called AspectM that supports modeling-level
    aspects.
  • We demonstrate the effectiveness of AspectM in
    terms of model evolution.

N.Ubayashi, T.Tamai Concern Management for
Constructing Model Compilers, MACS 2005
(Workshop at ICSE 2005) N.Ubayashi, T.Tamai, et
al. Model Compiler Construction Based on
Aspect-oriented Mechanisms, GPCE 2005 (to appear)
10
Extensible model compiler
Modeling
Aspect
AspectM
Aspect
UML model
UML model
weave
UML model
UML model
(ex. PIM)
(ex. PSM)
Extensible model compiler
Using AspectM, a modeler can extend model
transformation rules by defining new aspects in
the process of modeling.
11
Evolution at the modeling level
model compilation using aspects
Base Model
Variation
Ver.1
Model for Product n
Model for Product 1
Model for Product 2
model compilation using aspects
Version
Ver.2
Model for Product 1
Model for Product 2
Model for Product n
12
Advantage of our approach
  • Using our extensible model compiler, a series of
    models can be generated from a single abstract
    model that embodies only core concerns such as
    business logics.
  • The model does not include such concerns as
    platforms and application-specific optimizations.
    These concerns vary according to product
    specifications.
  • Model transformations enable us to shift from
    code-centric product-line engineering (PLE) to
    model-centric PLE.

13
2. An extensible model compiler based on AO
  • -- from our previous work

14
Aspect orientation
AOP is based on the JPM (Join Point Model).
Join point
program execution points including method
invocations and field access points
Pointcut
a means of extracting a set of join points
related to a specific crosscutting concern from
all join points
Advice
a means of raising effects at the join points
15
Aspect orientationat the modeling-level (example)
Extension of JPMs (Join Point Models) in AOP
16
JPMs for model transformations
PA(pointcut advice),CM(composition),NE(new
element),OC(open class),RN(rename),RL(relation)
17
AspectM
  • AspectM is an aspect-oriented modeling language
    that supports six kinds of JPMs.
  • In AspectM, an aspect can be described in either
    a diagram or an XML format.
  • AspectM provides the two kinds of aspects
    ordinary aspect and component aspect. A component
    aspect is a special aspect for composing aspects.
  • An aspect can have parameters for supporting
    generic facilities. By filling parameters, an
    aspect for a specific purpose is generated.

18
Example of AspectM descriptions
pointcut classA classB
aspect
advice
ltlt OC gtgt addAttributeX
classA
classA
add new attributes
new attributes
classB
classeAandB class pointcut-bodycname(cla
ssA) cname(classB)
classC
classB
new attributes
merge classAandB add-attribute
advice-bodyattributeX
ltaspect nameaddAttributeX typeordinary
jpmOC" gt ltpointcut nameclasseAandB
typeclassgt ltpointcut-bodygt cname(classA)
cname(classB) lt/pointcut-bodygt lt/pointcutgt
ltadvice nameadd-attributeX typeadd-attribute
ref-pointcutclassAandBgt ltadvice-bodygt
attributeX lt/advice-bodygt lt/advicegt lt/aspectgt
19
Implementation of model compiler
Aspect diagram (XML)
Model Compiler
XSLT style sheet for converting aspect (XML) to
XSLT style sheet
XSLT processor
The first transformation phase
XSLT style sheet for converting UML (XML)
to UML (XML)
The second transformation phase
XSLT processor
UML diagram (XML)
UML diagram (XML)
20
3. Evolution using extensible model compiler
21
Example of model evolution
Variation of Second Version
Original
First Version
Second Version
Platform concern
Optimization concern
Logging concern
logging
modifications crosscut over many places
logging
make a product that is executable on the Struts
platform
optimize memory usage
add a logging function for debugging
22
Model transformation for first version
Platform Struts
Step1 merge PIMs
1) merge PIM classes
Step 2 transform the merged class to an action
form bean class
platform concerns crosscut over model elements
2) change the name of merged class 3)
inherit ActionForm 4) add setter/getter
PSM
PIM
Step 3 create an action class
5) create an action class 6) inherit Action 7)
add execute method 8) add a method body
23
Aspect for the first version
Platform Struts
aspect
Step1 merge PIMs
ltlt CM gtgt MergeClasses
1) merge PIM classes
inputClasses class pointcut-bodycname(Me
ssage) cname(MessageProfile)

Step 2 transform the merged class to an action
form bean class
2) change the name of merged class 3)
inherit ActionForm 4) add setter/getter
merge inputClasses merge-by-name
advice-bodyPostMessage
Step 3 create an action class
5) create an action class 6) inherit Action 7)
add execute method 8) add a method body
24
Component, Generics
component
ltaspect name"Generic-Classes2ActionFormBean"
type"component"gt ltparamsgt ltparamgt
_at_input-classes_at_ lt/paramgt ltparamgt
_at_merged-class_at_ lt/paramgt lt/paramsgt ltaspect
name"MergeClasses" template"Generic-MergeClasses
"gt ltset-param name"_at_input-classes_at_"gt
_at_input-classes_at_ lt/set-paramgt ltset-param
name"_at_merged-class_at_"gt _at_merged-class_at_
lt/set-paramgt lt/aspectgt ltaspect
name"SetActionFormBeanName" template"Generic-Set
ActionFormBeanName"gt ltset-param
name"_at_class_at_"gt _at_merged-class_at_ lt/set-paramgt
lt/aspectgt ltaspect name"InheritActionForm"
template"Generic-InheritActionForm"gt
ltset-param name"_at_sub-class_at_"gtconcat(
_at_merged-class_at_ ,"Form")lt/set-paramgt lt/aspectgt
ltaspect name"AddAccessors" template"Generic-Add
Accessors"gt ltset-param name"_at_class_at_"gtconcat(
_at_merged-class_at_ ,"Form")lt/set-paramgt
lt/aspectgt lt/aspectgt
generics
Step1
Step2
25
Aspect for the second version
aspect
ltaspect name"DeleteAttribute"
type"ordinary" jpm"OC"gt ltpointcut
name"postMessageClass"
type"class"gt ltpointcut-bodygt
cname(PostMessage) lt/pointcut-bodygt
lt/pointcutgt ltadvice name"deleteDate"
adviceType"delete-attribute"
ref-pointcut"postMessageClass"gt
ltadvice-bodygt date lt/advice-bodygt
lt/advicegt lt/aspectgt
ltlt OC gtgt DeleteAttribute
postMessageClasse class
pointcut-bodycname(PostMessage)
merge postMessageClasse delete-attribute
advice-bodydate
26
Aspect for a variation
ltaspect name"LoggingSetter"
type"ordinary" jpm"PA"gt ltpointcut
name"allSetter" type"method"gt
ltpointcut-bodygt oname(set)lt/pointcut-bodygt
lt/pointcutgt ltadvice name"logSetter"
adviceType"before"
ref-pointcut"allSetter"gt ltadvice-bodygt
Log.write() lt/advice-bodygt
lt/advicegt lt/aspectgt
aspect
ltlt PA gtgt LoggingSetter
allSetter method pointcut-bodyoname(set
)
merge allSetter before
advice-bodyLog.write()
27
Model evolution (example)
Original Model
Aspect Generic-Classes2ActionFormBean
Version
Ver.1
Model for Struts Platform
Aspect DeleteAttribute
Aspect LoggingSetter
Version
Ver.2
Variation
Optimized Model for Struts Platform
Logging
28
Towards product-line engineering
defined by modelers
Aspect library for other platforms
Product X

Application-specific aspects
Aspect library for .NET
weave
Aspect library for J2EE
UML diagrams
Aspect library for other product-lines
Product Y

Application-specific aspects
Aspect library for product-line B
weave
Aspect library for product-line A
UML diagrams
Aspects are useful for product-line engineering
in which a variety of PSMs are generated from a
single set of PIMs.
29
4. Related work
30
Related work
Aspect-oriented domain modeling (AODM) J.Gray
et. al. 2003
AODM introduced a language called ECL that
provides facilities for adding model elements
such as attributes and relations.
Persistence as an Aspect A.Rashid and
R.Chitchyan 2003
Aspect-oriented mechanisms ( reflection) for
describing database concerns are proposed.
QVT OMG
QVT (Queries, Views, and Transformations) is a
model transformation language.
Draco J. Neighbors 1984
In Draco, software development processes were
considered as a series of transformations.
31
5. Conclusion
32
Conclusion
  • We propose a method for model evolution using an
    extensible model compiler based on aspect
    orientation.
  • A modeler can extend model transformation rules
    by defining new aspects in the process of
    modeling.

33
Appendix
34
Discussion-- Aspect-orientation vs. meta
programming
  • Someone might claim that AspectM is not an
    aspect-oriented language but a meta language for
    model transformations.
  • AspectM can describe not only model
    transformation concerns but also ordinary
    crosscutting concerns such as logging.
  • AspectM unifies (lightweight) meta-programming
    with ordinary aspect-orientation by extending the
    idea of JPMs.

lightweight meta-programming
aspect-orientation
JPMs
Write a Comment
User Comments (0)
About PowerShow.com