XAFIT provides a runtime environment for AF-RDL scripts Instantiation process inputs AF-RDL scripts...

Post on 17-Jan-2016

214 views 1 download

transcript

• xAFIT provides a runtime environment for AF-RDL scripts• Instantiation process inputs

AF-RDL scripts Framework model in AF-UML Application developer inputs

• Instantiation process output Application model in AF-UML (without annotations)

• The approach takes advantage of XQuery to perform transformations over serialized models (e.g. XMI)

Traditional OO abstractions fail to modularize crosscutting concerns Yet, such concerns may expose hotspots (e.g. persistence)

Hotspots of the same concern are not localized, hence are hard to identify and instantiate Aspects allow for a clean separation of concerns in AO Frameworks

AO Frameworks are Moving to Mainstream

Assisting Aspect-Oriented Framework InstantiationTowards Modeling, Transformation and Tool SupportMarcilio Mendonca, Paulo Alencar, Toacy Oliveira, Donald Cowan {marcilio, palencar, dcowan}@csg.uwaterloo.ca, toacy@inf.pucrs.br OOPSLA 2005 Poster Session

An approach to aspect-oriented framework instantiation based on modeling, transformation and tool support.

AOF Instantiation – A Case Study: CSGDrawing Editor (An Aspect-Oriented Drawing Editor Framework)

Representing Instantiation Steps

Our process language (AF-RDL) allows framework developers to represent instantiation steps explicitly

Sample Instantiation Unit IUNIT myInstantiationUnit ITASK myInstantiationTask … call R1(… ); … ITASK_END ITASK R1(…) call_pattern P1(…); ITASK_END …IUNIT_END

Main Instantiation Commands• extend_class(superclass, subclass)• extend_class(superclass)• extend_method(superclass, subclass, method)• extend_aspect(superaspect, subaspect)• extend_aspect_method(superaspect, subaspect, method)• extend_aspect_pointcut(superaspect, subaspect, pointcut )

Types: Class, Aspect, Method, Attribute, Pointcut, Boolean, Number, String, Package

Sample Pattern LibraryPATTERN_LIBRARY myPatternLib PATTERN Observer(…) … END_PATTERN

PATTERN AbstractFactory(…) … END_PATTERN …END_PATTERN_LIBRARY

Modeling AO Frameworks Supporting AutomationBut Instantiation is still Complex

Lack of Documentation Approaches for AOFs Current Modeling Languages are either:

• UML Profiles for Aspect-Oriented Systems

(e.g. aSideUML, Theme/UML)• UML Profiles for Object-Oriented Frameworks

(e.g. UML-F, UML-FI)

There is no standard way to represent

instantiation steps across AOF projects Every new framework project may also imply new

strategies and approaches for application generation Instantiation steps may be hidden and hard to maintain

(e.g. hardcoded in application generators)

Automation of AOF instantiation is needed Lack of automated tools supporting aspect-oriented

concepts Aspects are not considered as first-class citizens

Model Transformation can be Helpful

Framework Instantiation: semi-complete complete model transformation Model transformation is a trend (e.g. Model-Driven Architecture) In MDA, models can be serialized to XML (e.g. XMI specification)

Our approach uses XQuery to transform serialized models (e.g. XMI)

Next Steps

AF-UML extends UML to support Frameworks and Aspect-Oriented

concepts (e.g. aspects, variability) – Aspect Diagram

AF-UML = UML + Aspect + Frameworks

Components of Our Approach: Modeling Language: AF-UML Process Language: AF-RDL CASE Tool (transformation): xAFIT

xAFIT = AF-RDL → xQueryAF-RDL = Instantiation Commands

Our Approach to AO Framework Instantiation

Man

dato

ry C

lass

and

Met

hod

Ext

ens

ion

Sele

ct One S

ubcla

ss

Man

dato

ry A

spec

t, M

eth

od,

and

Poi

ntcu

t E

xten

sion

Graphical Interface

AF-RDL ParserXQuery Engine XMI Handler

xAFIT System Facade

ParserTransformation Engine Model Handler

List of Variabilities

Variability Extension Mechanism

The Figure objects that should notify the Display about state changes

Pointcut Extension

The shapes (e.g., Circle, Square)

Class Extension

The drawing, enlarging and shrinking algorithms for the shapes

Method Extension

The set of shapes that will be part of the drawing

Method Extension

The drawing algorithm Method Extension

The Display response algorithm to Figure resizing

Aspect Method Extension

IUnit CSGDEFramework // Instantiation Unit

ITask Main // Instantiation Task myShape : CLASS; myDrawer: CLASS; myObserverAsp : ASPECT; loop myShape = extend_class(“Figure”, ?); extend_method(“Figure”, myShape, “draw”); extend_method(“Figure”, myShape,”enlarge”); extend_method(“Figure”, myShape,”shrink”); loop_end myDrawer = extend_class(“Drawer”, ?); extend_method(“Drawer”, myDrawer, “createFigures”); extend_method(“Drawer”, myDrawer, “draw”); myObserverAsp = extend_aspect(“DEObserverAspect”,?); extend_aspect_method(“DEObserverPattern”, myObserverAsp, “updateObserver”); extend_aspect_pointcut(“DEObserverPattern”, myObserverAsp, “Subject.notifyObservers”); ITask_END

IUnit_END

AF-RDL Script (Instantiation Steps)AF-UML Framework Aspect Diagram• Define a graphical model to represent instantiation steps

(Instantiation Model). Link its elements to AF-UML.• Integrate feature models to our approach• Refine the AF-UML modeling language

xAFIT Architecture Overview

AF-UML Application Aspect Diagram(Without Annotations)

XQuery TransformationFramework Model Serialized (e.g. XMI) Application Model Serialized (e.g. XMI)Variability Model (e.g. Feature Model)