uml for aspect oriented design

17
Understanding The need of A UML- based-3D modeling tool for Aspect- oriented Software Development Jorge Edison Lascano ESPE Faculty Member USU Phd student

Upload: edison-lascano

Post on 14-Jul-2015

200 views

Category:

Engineering


3 download

TRANSCRIPT

Understanding The need of A UML-based-3D modeling tool for Aspect-

oriented Software Development

Jorge Edison Lascano

ESPE Faculty Member

USU Phd student

Motivation

• Aspect-oriented Software Development, the need of modeling tools and techniques has arisen

• The most accepted Modeling Language is UML

• When weaving the modeled aspects in the base models, the woven code disappears visually to the designer, making difficult if not impossible to verify the Cross-Cutting Concerns (CCC) throughout the generated diagrams.

The solution

• A 3D-modeling/viewing tool based on UML and AspectJ to surpass a real representation of the woven advices in the correspondent join points for any AOSD project in its modeling from requirements, to analysis and design

Introduction

• a tool should be capable to apply reverse engineering to get the UML diagrams and allow to see where Aspect Oriented is applied.

• UML diagrams do not give a correct representation of the weaving, and they visualized the merged diagrams as traditional UML diagrams, therefore, CCCs got lost visually and the developers can not track their models.

Introduction

• In a 3D modeling tool, the third dimension would be the Cross-cutting concern(s) represented by an aspect, and the two dimensions will be the base diagrams before applying the correspondent advice.

Aspect Oriented Programming

• According to Kuloor and Eberlein, AOP“focuses on identifying crosscutting concerns in a system and implement them as a collection of loosely coupled aspects.”

Definitions

• A concern, is a requirement of the system, and if this affects more than one class and their actions are tangled, it is called a crosscutting concern.

• an Aspect, is a construct that allows the introduction of some new behavior, the advice, in some point of the program, the join point.

Definitions

• Inter-type declarations, an aspect also may introduce new attributes or inheritance, an inter-type declaration.

• Weaving. The process of interfering the common state or behavior of one or more classes by an aspect is known as weaving. Weaving may happen when code is written, through compile-time, post-compile time, load time and run-time

AOP support

• Haskell, • Java AspectJ, • JavaScript, • Logtalk, • Lua, • make, • ML, • PHP, • Racket, • Perl, • Prolog, • Python, • Ruby, • Squeak Smalltalk.

• .NET Framework languages (C# / VB.NET),

• ActionScript, • Ada, • AutoHotkey, • C / C++, • COBOL, • The Cocoa Objective-C

frameworks, • ColdFusion, • Common Lisp, • Delphi, • Delphi Prism, • Emacs Lisp, • Groovy,

AspectJ

• An aspect in AspectJ is defined as a class with three main sections:

• its attributes, which are a set of local variables that can represent the state of the aspect;

• the pointcuts, which will define the points where the behavior of the base code will be affected, usually they are defined as executions or as calls based on a signature that specify the set of points (join points); and

• the advices that implement the behavior to be injected before, after or around the specific join point.

Sample code

• public abstract aspect DeployingGenerator {• static boolean isCodeGenerated;• static boolean isCodeBuilt;• static Object obj;• StringBuilder sb=new StringBuilder("");•

• abstract pointcut generateCode();• abstract pointcut build();•

• boolean around () : generateCode(){• obj=thisJoinPoint.getTarget();• isCodeGenerated = proceed();• sb=new StringBuilder("");• if(!isCodeGenerated){• sb.append(obj.getClass().getSimpleName() + ", when " +

thisJoinPoint.getSignature().getName() + "ing, was " + isCodeGenerated);• sb.append("\nRead log screen to locate the errors");• JOptionPane.showMessageDialog(Screens.frm05BP, sb.toString());• }• return isCodeGenerated;• }• }

UML and aspects

A logging Aspect Model using a UML collaboration Stereotype, source: Kande et al.

UML and Aspects

Sequence Diagram Weaving Example, source: Kienzle et al.

3D UML modeling

• There is a need to address the orthogonal modeling of Core components alongside aspectual components”, so a 3D modeling tool is needed.

• pointcuts and advice affect program flow (SD), inter-type declarations affect a program´s classes structure”

• the weaving process, Aspects, Pointcuts and Advices are modeled as classifiers; Pointcuts and advices also need SDs

An example of 3d UML Class Diagram

Class Diagrams merging

Questions ?

References

• Kuloor; Ch., Eberlein; A., 2003. “Aspect-Oriented Requirements Engineering for Software Products Lines”, 2003 IEEE Computer Society

• Kande; J., Kienzle; J., Strohmeier; A., 2002. “From AOP to UML – A Bottom-up Approach” Workshop on Aspect-Oriented Modeling with UML at AOSD2002, Enschede, The Netherlands, April 22, 2002

• Kienzle; J., Abed; W., Klein; J., 2009. “Aspect-Oriented Multi-View Modeling”, March 2-6, 2009 AOSD, pp. 87-98.