An Approach for Supporting AspectOriented Domain Modeling - PowerPoint PPT Presentation

1 / 31
About This Presentation
Title:

An Approach for Supporting AspectOriented Domain Modeling

Description:

An Approach for Supporting. Aspect-Oriented Domain Modeling. GPCE 2003 Erfurt, Germany ... author James Todd [gonzo_at_eng.sun.com] ... – PowerPoint PPT presentation

Number of Views:59
Avg rating:3.0/5.0
Slides: 32
Provided by: jeff92
Category:

less

Transcript and Presenter's Notes

Title: An Approach for Supporting AspectOriented Domain Modeling


1
An Approach for Supporting Aspect-Oriented
Domain Modeling
University of Alabama at Birmingham
Vanderbilt University
  • GPCE 2003 Erfurt, GermanySeptember 24, 2003
  • Jeff Gray, Ted Bapty, Sandeep Neema, Doug
    Schmidt, Andy Gokhale and Bala Natarajan
  • gray (at) cis.uab.eduhttp//www.gray-area.org

This research is funded by DARPA/IXO, under the
PCES program.
2
Motivating Problem Crossccuting Constraints in
Real-Time/Embedded Models
Changeability???
  • Base models become constrained to capture a
    particular design

A
B
F
c
d
e
B
B
c
d
e
c
d
e
3
Importance of Changeability in Modeling
  • Modelings key advantage
  • Ability to rapidly explore what-if design
    alternatives
  • Changeability a metric for modularity
  • The way to evaluate a modular decompositionis
    to ask what changes it accommodates. David
    Weiss, chapter preface in Software Fundamentals
  • Ensure benefit of model-driven approach
  • Small changes in requirements entail large
    changes in the structure and configuration

Gerald Jay Sussman, Robust Design through
Diversity, DARPA Amorphous Computing Workshop,
1999.
4
Motivation Summary
  • Key Problems
  • Difficult to specify and manage cross-cutting
    concerns (e.g., constraints) in model-based
    systems
  • Lack of tool support for automatically weaving
    concerns into models
  • Our Solution
  • A meta framework that assists in the construction
    of model weavers, capable of rapidly dispersing
    global concerns across a design space not just
    notational

5
Modeling Context MIC/GME
  • Key focus of this paper
  • Weaving of high-level concerns into domain model
  • Framework for creating new weavers for each
    meta-model


6
Process of Using a Model Weaver
7
Quantification Over Base Code
  • An AspectJ example

Advice
after(Object o) throwing (Error e) pubIntf(o)
log.write(o, e)
pointcut pubIntf(Object o) call(public
com.borland..(..)) target(o)
Pointcut
8
Quantification Over a Domain Model
  • Apply AO Weaving concepts to Model-based systems
  • Weavers Decorate Models with attributes
    constraints
  • Weavers compose new model constructs

Model
Domain-specific Strategies
Strategy1 Strategy2 Strategy3 StrategyN
select(p p.name() Model
p.kind() StateFlow)-gtStrategy3()
Modeling Pointcut
9
Constructing Model Weavers
10
Domain-Specific Weavers
General Motors Factory
DuPont Chemical Factory
Boeing Bold Stroke



GM specific weaver
DuPont specific weaver
Bold Stroke specific weaver
Example Evidence of meta in the corresponding
XML of each of the above models
11
The Metaweaver Framework
ModelingPointcuts
XML Parser
Strategies (C)
Aspect Parser
XML (Model Hierarchy)
Strategies
Strategy Code Generator
strategy ApplyConstraint(constraintName string,
expression string) addAtom("OCLConstraint",
"Constraint", constraintName).addAttribute("Expres
sion", expression)   strategy
RemoveConstraint(constraintName string)
findAtom(constraintName).removeChild()   strate
gy ReplaceConstraint(constraintName string,
expression string) RemoveConstraint(constrai
ntName) ApplyConstraint(constraintName,
expression)
12
Embedded Constraint Language
Included OCL Operators
13
Embedded Constraint Language
  • Traditional OCL has been strictly a declarative
    query language
  • New uses require an imperative procedural style
  • Addition of side effects into model
  • Examples
  • addAtom(), findAtom()
  • addAttribute(), findAttribute()
  • removeNode()
  • Support for recursion
  • Chaining of strategies (procedure calls)
  • Inlined C code

14
List of ECL Operators
15
Example Processor Assignment
  • Weapons deployment

16
Processor AssignmentComponent Interaction Model
17
Processor AssignmentComponent Internals
18
Processor AssignmentModeling Pointcut
  • aspect ProcessorAssignment
  • models("")-gtselect(m m.kind()
    Comp")-gtAssign(10)

19
Processor Assignment Strategy
  • strategy Assign(limit integer)
  • declare static accumulateWCET, processNum
    integer
  • declare currentWCET integer
  • self.compute.WCET.getInt(currentWCET)
  • accumulateWCET accumulateWCET currentWCET
  • if (limit lt accumulateWCET) then
  • accumulateWCET currentWCET
  • processNum processNum 1
  • endif
  • ltltCComBSTR aConstraint "self.assignTo()proces
    sor"
  • XMLParseritos(processN
    um) gtgt
  • AddConstraint("ProcessConstraint",
    aConstraint)

20
Processor AssignmentWeaved Constraint
strategy Assign(limit integer) declare
static accumulateWCET, processNum integer
declare currentWCET integer
self.compute.WCET.getInt(currentWCET)
accumulateWCET accumulateWCET currentWCET
if (limit lt accumulateWCET) then
accumulateWCET currentWCET processNum
processNum 1 endif ltltCComBSTR
aConstraint "self.assignTo()processor"
XMLParseritos(processNum)
gtgt AddConstraint("ProcessConstraint",
aConstraint)
21
Code Generation Example
  • Consider the following, which appears in an
    EagerLazy strategy
  • components.models()-gtselect(c
  • c.id()
    refID)-gteagerLazy()

22
Code Generation Example
CComPtrltIXMLDOMNodeListgt models0
XMLParsermodels(components, "")
nodeTypeVector selectVec1 XMLParserConvertDomL
ist(models0) nodeTypeVector selectVecTrue1
new stdvectorltnodeTypegt vectorltnodeTypegtit
erator itrSelect1 for(itrSelect1
selectVec1-gtbegin() itrSelect1 !
selectVec1-gtend() itrSelect1)
nodeType selectNode1 (itrSelect1)
nodeType c c selectNode1 CComBSTR
id0 XMLParserid(c) ClData
varforward1(id0) ClData varforward2(referred
ID) bool varforward3 varforward1
varforward2 if(varforward3)
selectVecTrue1-gtpush_back(itrSelect1)
vectorltnodeTypegtiterator itrCollCall1
for(itrCollCall1 selectVecTrue1-gtbegin()
itrCollCall1 ! selectVecTrue1-gtend()
itrCollCall1) eagerLazyapply()
23
Sample XMLParser Methods
nodeType XMLParseraddAtom(nodeType self,
CComBSTR kind, CComBSTR role, CComBSTR name)
return addNode(self, "atom", kind, role,
name) nodeType XMLParserfindModel(nodeType
aNode, CComBSTR name) CComBSTR
bstrFind(L"./modelname\"") bstrFind.Append(name
) bstrFind.Append("\"") return
submitXPath(aNode, bstrFind) CComBSTR
XMLParserid(nodeType aNode) CComBSTR
res CComPtrltIXMLDOMNodegt attr
XMLParserfindAttribute (aNode, "id")
XMLParsergetStr(attr, res) return res
24
Summary
25
Summary Benefits of this Approach
  • The modeler can now perform various what-if
    scenarios using modeling constraints
  • Impossible in previous approach
  • Constraints can be plugged/unplugged in model
  • Because much of the redundancy of constraint
    application is removed, the effect of each
    constraint on the global system can be better
    understood. This localization of constraints
    improves modular reasoning.
  • Allows for the rapid construction of new
    domain-specific weavers
  • Strategies are specified using a DSL
  • Generated code is at a much lower level

26
For more information
  • Please give us another week to upgrade site
  • gray (at) cis.uab.edu
  • http//www.gray-area.org/Research/C-SAW
  • GME (freely available)
  • http//www.isis.vanderbilt.edu/Projects/gme/
  • OMG MIC PSIG
  • http//mic.omg.org

27
A Concluding Quote
  • Even for this let us divided liveThat by this
    separation I may give that due to thee which thou
    deservest alone.
  • William Shakespeare, Sonnet XXXIX

28
Extra slides
29
Tool Independence
  • Requires an exposed API for accessing internal
    model data structures
  • Tool-specific adapters written for each new
    supported tool

Rose
GME
Cadena
MetaEdit
30
Adaptive Core Weaving Engine
31
Not unlike AspectJ AJDT
AJDT
Write a Comment
User Comments (0)
About PowerShow.com