Journal of Computing and Information Technology - CIT 14, 2006, 2, 111–131 111 doi:10.2498/cit.2006.02.03

From to AspectJ: A Platform SpecificModel Transformation

Djamel Meslati1, Mohamed T. Kimour1 and Sa¨ıd Ghoul2

1 Laboratory of Research on Computer Science (LRI), University of Annaba, Algeria

2 Computer Science Department, Philadelphia University, Amman, Jordan 

Both model-driven architecture MDA and aspect- model that has the salient characteristic that it 

oriented programming AOP are promising paradigms  can be executed by a machine 7, 16, 17 . that are very attractive for the software engineering com- munity. While the former is an approach to application A metamodel is a special kind of model that design and implementation using models as first class entities, the latter advocates the separation of concerns specifies the abstract syntax of a modeling lan- as an approach to tackle most software development guage. In the MDA context, each model is an and maintenance problems. MDA and AOP can be instance of a metamodel that is described us- related in various ways and their combination seems ing the OMG MOF Object Management Group

to be a promising issue. In this article, we focus on 

the transformation of two AOP approaches, composition Meta Objet Facility19 . A transformation is  filters CF and ASPECTJ, considered as platform specific the process that converts one model to another metamodels within the MDA context. We propose a model of the same system according to some transformation of CF models into ASPECTJ models using

a syntax-directed translation and a set of transformation description which, in turn, is a model and an  templates. In addition to being easy to implement, instance of some metamodel 14, 18 . our transformation approach covers the most important

concepts of CF. Broadly speaking, MDA is an approach where  models are first class entities 8, 14 . A software Keywords: aspect-oriented programming,ASPECTJ, com- system can be seen as a collection of models of position filters, model-driven architecture, model trans- formation. various abstraction levels where each describes the system from some viewpoint and, conse- quently, most engineering tasks can be consid- ered as modeling and transforming models. 1. Introduction In order to promote interoperability and porta- bility, the MDA approach puts the emphasis on Model-driven architecture is an approach to sys- two kinds of models with respect to specific

tem development that provides means for us- platforms: the platform independent models

   ing models to direct the course of systems un- PIM and the platform specific models PSM .

derstanding, design, construction, deployment, Within each of these abstractions, there can be a

 

operation, maintenance and modification 18 . number of refinements for example, many lev-  The core concepts of MDA are models, meta- els of platform independent models14 .For models and transformations. A model is a rep- example, a program is a PSM obtained through- resentation of a part of the function, structure out a cascade of models and transformations. At

and or behavior of a system. A model spec- the top, we find a use case PIM that highlights ification can be formal when it is based on a aspects of the system corresponding to the user language that has a well defined syntax, seman- view. Then, the use case PIM is transformed

tics and possibly rules to analyze its constructs to extract objects and classes which form an-  17 . Under this definition, a source code is a other PIM. The last transformation might be a 112 From Composition Filters to AspectJ: A Platform Specific Model Transformation

JAVA model which is specific to a JAVA platform sibility, simplifies component integration and

  i. e. the JAVA virtual machine . Notice that a decreases invasive changes 2, 12, 20 .

“platform specific” is meaningful only relative Today, a large amount of literature is devoted  to a particular point of view 8 . For example, to three SOC approaches: composition filters

the JAVA program is a PSM when considering a

   CF 5 ,ASPECTJ 12 and hyperspace ap-

specific JAVA platform, while it is a PIM when  proach 20 . They aim at providing better con- considering the specific operating systems on cepts and mechanisms to appropriately sepa- which the JAVA virtual machine is implemented. rate the software concerns from the business In the MDA approach, transformations can be logic. Unfortunately, each approach has its own of various types such as merging or composing philosophy and concepts. An approach might models, but usually they convert models offer- be suitable from some point of view, but in- ing a particular view from one level of abstrac- appropriate from another. Consequently, pro-

tion to a less abstract one e.g. PIM to PSM or viding an environment where multiple AOP ap-

PIM to PIM , by adding more details supplied proaches can be used simultaneously is a worthy  by the transformation rules 14 . Transforma- goal. This article is an attempt towards this goal tions between models are needed because: that focuses only on the transformation of CF models to ASPECTJ models. Our interest in CF Metamodels use various modeling concepts and ASPECTJ results from the fact that they are and notations to highlight one or more views both AOP approaches. within a model, depending on what is rele-

The remainder of this article is composed of  vant at any point in time 18 . six sections. Sections 2 and 3 describe, re-

Metamodels influence the modeling task and spectively CF and ASPECTJ metamodels in an the perception we have of the real world. intuitive way. In section 4 we give the motiva- Thus it is beneficial to use various metamod- tions of the work and in section 5 we present

els to capture the real world subtle situations CF to ASPECTJ transformation. Section 6 dis-  during the engineering tasks 8 . cusses related work, and section 7 conclusion and future work. According to “divide and conquer” princi- ple, the engineering tasks can be simpli- fied if complex system models are com- posed or merged from less complex models 2. The Composition Filters Metamodel using transformations that supply necessary details. 2.1. Principle and Goals In this article, we focus on the transformation of two AOP approaches, CF and ASPECTJ, by CF considers a system as a set of objects that considering them as two platform specific meta- interact with each other to achieve a common models within the MDA context. This work is a task. Most interactions are done by sending and

part of an ongoing one that aims to construct an receiving messages and CF intervenes during  MDA environment where software developers these interactions 3, 6 . It provides an object can use multiple AOP metamodels, during the with an interface containing filters that inter- engineering tasks, and freely switch from one cept and manipulate messages in various forms, another, using automated tools that preserve the modifying their scope and expected behavior. concerns’ traceability. The former consists of delegating messages to

other objects i. e. changing the target object

AOP is a particular separation of concerns ap- to which the message is sent, whereas the lat-  proach SOC , where a system can be seen as ter consists of substituting a message selector

composed of business logic and concerns such with another i. e. replacing the name of the as synchronization, security, persistence, etc. It method to be called with the name of another

is now commonly admitted that an appropri- one to be called instead. By controlling mes-

  ate separation of concerns have an influence on sages changing their targets and or selectors the development and maintenance processes. It and through a well-constructed interface, CF

reduces the software complexity and code tan- provides suitable solutions to many problems

 gling, facilitates reuse, improves comprehen- see 2 ,suchas:

From Composition Filters to AspectJ: A Platform Specific Model Transformation 113 Dynamic inheritance by enabling and dis- Input filters: A set of declarative specifica- abling inheritance relation between classes tions that handle the incoming messages. at runtime

Output filters: A set of declarative specifi-

Modeling of state dependent behaviors where cations that handle the outgoing messages. the behavior of an object changes according to its state Object without filters

History sensitivity where the behavior of an Received messages Control Flow object depends on its previous behaviors Kernel object Method Reference

Providing multiple views of the same object

Method Instance  see example in 2.3 Variable Method Behavior coordination and synchronization Instance Variable

Tracing of programs during the development One of the CF strengths is the use of a uniform Sent messages filtration mechanism to resolve the above prob- CF object lems. From this point of view, CF is easy to Received messages Input Filter understand and work with as it only adds few Input Filter CF Interface concepts to the object metamodel. Input Filter

Kernel object Method Instance Variable 2.2. Basic Concepts Instance Variable Instance Variable

Method Instance messages Delegated Variable CF adds to an object a wrapping layer called Method Internal Instance Object External interface that traps incoming and outgoing Internal Object Condition Variable InternalIt Object messages. Figure 1 depicts the contents of an Object External interface added to a kernel object. We refer to Condition Object object or class with a CF interface by CF object Instance Variable

Instance Variable External  respectively CF class . Instance Variable Object A CF interface is composed of the following parts: Output Filter Output Filter

Internal objects are objects whose methods Output Filter Sent messages are used to compose the behavior of the CF object. Messages received by a CF object can be delegated to internal objects instead Fig. 1. An object before and after adding a CF interface. of the kernel object. Internal objects are en- capsulated in the CF object and cease to exist when the CF object is garbage collected. The signature of a CF object is the set of pub- lic methods that it responds to. This includes External object are almost like internal ob- public methods of the kernel class and public jects. However, they are supposed to exist

methods of the internalexternal objects. In the on their own and their references are passed case where two methods have the same name, on to the CF class constructor during instan-

that of the kernel or the internalexternal ob- tiation. These references are assigned to the ject declared first in the interface, hides the

corresponding CF instance variables. other. Within a CF object, the kernel and in-  Methods: Contains all the public methods ternal external objects are called targets. The of the kernel class. target of a message is determined by the CF object itself when a message is received and Conditions: Conditions are specific meth- becomes a data accessible to filters. ods without parameters that supply informa-

tion about the context of a call and the kernel Filters are declared in ordered sets as declara-  state without changing them 6 . tive specifications. A call entering a CF object

114 From Composition Filters to AspectJ: A Platform Specific Model Transformation

 

is first reified i. e. the method selector becomes type see Table 2 . Each filter element speci-

C 

accessible and target determined, then passes fies a condition and a list of pairs matching MSPList each filter in the set until it is discarded or dis- part, substitution part. We call it for patched. Discarding a call raises an exception, short. A FE accepts a call if the condition is true

whereas dispatching consists of: and if the call matches the MSPList Figure 2 depicts the syntactic diagrams corresponding to

Activating the corresponding method in the different forms of filter elements.

kernel or internalexternal objects, or To simplify the filter set specification, CF pro-

Substituting it with a call to another method

 poses two operators and called respec-

in the kernel or internalexternal objects and

activating it. tively inclusion and exclusion operators. C MSPList means that when the condition C is true,

Each filter can accept or reject a call with an any message that matches MSPList will be ac-

 MSPList effect depending on the semantic of its type. cepted. C means that when the

Accept may imply dispatching or simply ig- condition C is true, all messages, except those

noring the message which, then, passes to the in MSPList, will be accepted. next filter. Reject may imply that a message is discarded, queued as long as the filter expres- In the following, we use two filter examples to illustrate the syntactic diagrams of Figure 2. sion results in a rejection, or merely ignored i.

e. the message continues with the next filter,  see Table 1 . There are five commonly used Filter Element

MSPList

Dispatch Wait Meta filter type: Error, , , ,and

Ÿ

 RealTime 5 . Each type deals with a certain Condition Call category of concerns, but in general a filter set a!

contains more than one type. Wait is used to MSPList MSP model synchronization concerns, Meta allows the reification of a message so that access to { MSP } its arguments, sender, receiver, return value, be- , MSP

comes possible and Realtime deals with timing Matching part Dispatch constraints. Error and are used alone Substitution part or in combination with other filter types to al- Matching Part low the modeling of various concerns. All filter Selector types can be used in input and output filters, ex- Target .

cept Dispatch which is used only in input filters. In many CF articles, authors consider that out- Substitution Part put filters operate almost like input filters and ( Target . Selector ) do not require specific treatment. Moreover, Target, Selector the object-oriented paradigm tends to adopt a Identifier clientserver model where the server respon- * sibility is prevalent. Therefore, concerns are usually related to servers rather than scattered Fig. 2. Syntactic diagrams of filter elements. among several clients i. e. modeled in an in-

put filter set rather than in several output ones 

4 . For these reasons, output filters are not Error As an example, let err be an filter de- considered in this article.

fined in the CF interface of a class called Ker. C To enhance the descriptive power of CF, each FE stands for filter element, for condition and

filter is composed of several elements called fil- S for message selector.  ter element FE that have the following form:

FE1 FE2 FE3 FE4

Filtername Type fFilterElement

err : Error = { c1Ÿ { s1, s2 }, c2a>{s4}, c3 a> *, a> s5 }

FilterElement g

An incoming message passes through each fil- C

ter element which accepts or rejects it. Again, FE1 specifies that when 1 is true, only calls to

S FE C reject or accept meaning depends on the filter S1 and 2 are accepted. 2 specifies that if 2

From Composition Filters to AspectJ: A Platform Specific Model Transformation 115 FE is true, only the call S4 is rejected. 3 has a 2.3. Example

“*” as a selector to specify that any message is FE rejected when C3 is true. 4 rejects all calls to As an illustration, let us consider an Email sys-

S5. tem example. The system is composed of four

Recipient DeliveryAgent classes Sender, , ,and

Now, let us consider a dispatch filter distr de-

the main class called Email which is partially nt fined in the CF interface of class Ker stands shown in listing 1. for a new target.

Filter Type Handler actions FE1 FE2 Accept: The accepted message continues with the next distr : Dispatch = { c1Ÿ { s1(nt1.ns1), s2 }, {s3}, Error filter in the filter set. Reject: An exception is raised.

c2 Ÿ { s4(nt2.*) , *(nt3.ns2) }, c3 Ÿ *(nt4.*) } Accept: The accepted message is reified as an object FE FE of class Message and sent to a meta object method as 3 4 an argument. The meta object is one of the internal or external objects (meta object and its method are specified in the filter element that accepted the message). Within the meta object method, it is

FE1 is a filter element with two parts. The first possible to use three specific statements: continue,

reply, and send. When continue statement is used,

S nt ns  one can be written C1 1 1 1 . It has all the reified message is reactivated and continues with the needed information i. e. condition, selector, the next filter in the filter set. When the reply Meta statement is used, the reified message is no longer new target and new selector and specifies that

considered and the sender receives the argument of the S

when C1 is true, messages having selector 1 are reply statement. With the send statement, the reified nt delegated to method ns1 of object 1,whichis message is reactivated (like continue statement) until it reaches the return statement, so that the meta object

an internal or external object. The second part method can have access to the return value of the

S can be written C1 2, it means that messages message. The send statement is followed by reply or continue statement. No substitution is carried out. having selector S2 are accepted and executed by Reject: The message continues with the next filter in the kernel object itself. FE2 lacks a condition the filter set. and an operator. In this case, default value True Accept: The message continues with the next filter in and inclusion operator are assumed instead. FE3 the filter set. No substitution or delegation is carried has a “*” as message selector. In the beginning out. Wait Reject: The rejected message is blocked until the “*” means accept any message and instead of condition corresponding to the matching part who the new selector it indicates that selector S4 will matched the message becomes true. The message is

then re-evaluated by the wait filter. S remain unchanged i. e. the new selector is 4

Accept: If a new target and/or a new selector are

FE C itself. 4 specifies that when the condition 3 specified in MSPList, they are substituted in the is true, any call to any methods is delegated to accepted message, and then, the message is sent to the

Dispatch nt nt nt nt4 using the same selector. 1, 2, 3 and new target. The remaining filters in the filter set are no longer considered. nt4 must be internal or external objects. Table 1 Reject: The message continues with the next filter in summarizes the acceptance and rejection mean- the filter set. ing for a filter according to its type. Table 2, Accept: The timing attributes of the accepted message shows when a filter element accepts or rejects are changed, and then, the message continues with the Realtime next filter.

a message and the effect on the filter level see Reject: The message continues with the next filter in

  4 for more details . the filter set. In Table 2, we consider that an incoming mes-

Table 1. The filter handler actions. S sage has T as the target object and as selector.

According to the value of condition C,andif

MSPList

Recipient DeliveryAgent there is a matching with , the effect Sender, and are

on the filter element will be to acceptreject a threads that coordinate their behavior using a buffer

call and, in turn, this will have an effect on the bounded synchronization schema. A Email whole filter, which may accept or reject the call Sender thread creates an object, fills in or merely let the message continue with the next the content, indicates the address and puts it in

FE. the DeliveryAgent buffer. The latter stamps the 116 From Composition Filters to AspectJ: A Platform Specific Model Transformation

Filter T.S matches Effect when is used Effect when a> is used Syntax used to specify the filter element C value Ÿ type MSPList on FE on filter on FE on filter

C Ÿ { T1.S1, …, Ti.Si}Or False False/True Reject Continue Reject Continue Error C a> { T1.S1, …, Ti.Si} True False Reject Continue Accept Continue MSPList is {T1.S1, …, Ti.Si} No substitution or delegation carried out True True Accept Accept Reject Reject False False/True Reject Continue C Ÿ { T1.S1(MO1.MS1), …, Ti.Si(MOi.MSi)} a> is not used with meta Meta True False Reject Continue MOi is the meta object and MSi one of its methods filter True True Accept Accept False False Reject Continue Reject Reject C Ÿ { T1.S1, …, Ti.Si} Or Wait False True Reject Reject Reject Continue C a> { T1.S1, …, Ti.Si} No substitution or delegation carried out True False Reject Continue Accept Accept True True Accept Accept Reject Continue C Ÿ{T1.S1(NT1.NS1),…,Ti.Si(NTi,NSi),}Or False False/True Reject Continue Reject Continue Dispatch C a> { T1.S1, …, Ti.Si,} True False Reject Continue Accept Accept NTi.NSi are the new target and the new True True Accept Accept Reject Reject selector C Ÿ { T1.S1(TC1), …, Ti.Si(TCi)} False False/True Reject Continue a> is not used with real Realtime True False Reject Continue TCi is the timing constraint time filter No substitution or delegation carried out True True Accept Accept

Table 2. Filter elements acceptance or rejection and their effect on the containing filter. Recipient Email object, then delivers it to the face which contains a set of filters enforcing buffer. the views. Threads that hold a reference on an Email object Threads may invoke any Email method, but in- can invoke all its methods. Thus, the delivery put filters reject or accept the message according agent can read the email content; the recipient to the sender type. Details of the CF interface can stamp the email itself etc. These manipu- are given in listing 2. lations do not correspond to a correct use of an email in the real world. An Email object should provide multiple views depending on the client class Email interface { type, i. e. the object issuing the call. For ex- internals // No internals or externals needed in this case

ample, readContent should not be available externals

conditions

to the delivery agent, stamp should not be private Boolean deliveryAgentView() {…} available to recipient and sender, etc. // Returns true if the client object is of type DeliveryAgent private recipientView() {…} // Returns true if the client object is of type Recipient public class Email { private Boolean senderView () {…} public void modifyContent(String text){…} // Returns true if the client object is of type Sender // Modifies the content of the Email with a field of type String inputfilters public String readContent(){…} err : Error = { // Returns the Email content deliveryAgentView() Ÿ {readRecipientAddress, public Boolean deleteContent(){…} readSenderAddress, stamp}, // Deletes the Email content and returns a boolean as an indicator recipientView() Ÿ { readContent, deleteContent, public void setRecipientAddress(Address C){…} readSenderAddress, readRecipientAddress }, // Address in C becomes the recipient’s address senderView() a! { stamp } } public Address readRecipientAddress(){…} delegate : Dispatch = {true => *(inner.*)} /* All messages // Returns the recipient’s address that pass err are delegated to the kernel which is called inner */ public void setSenderAddress(Address C){…} } // Address in C becomes the sender’s address public Address readSenderAddress(){…} // Returns the sender’s address Listing 2. A CF interface for class Email. public Boolean modifyAttributes(Attributes A){...} // A contains new attributes (urgency mark, number of tries, …) public void stamp(Date d, Time t){…} } // Adds the date and time when t he Email was first processed

In this CF interface, filter err specifies that

if the client is of type DeliveryAgent, only

Listing 1. The Email class. readSender

methods readRecipientAddress, Address and stamp areallowedtopasstothe

Multiple views problem has a suitable answer next filter and then be dispatched to the kernel, MSPList in CF by adding to class Email a CF inter- otherwise, an exception is raised. The From Composition Filters to AspectJ: A Platform Specific Model Transformation 117

of the filter err consists of only a list of selec- 3.2. Basic Concepts

tors. If the client is of type Sender, all methods

are accepted except stamp. Notice that this FE can be expressed using the inclusion operator ASPECTJ is a general-purpose AOP extension

and when ignoring inherited methods of class to JAVA . It uses four new concepts: Aspect,

Pointcut static crosscutting Email, as follows: , and .

An aspect is an entity that looks like a class, but

fmodifyContent readCon

senderView models a concern that crosscuts several object

tent deleteContent setSenderAddress classes. To understand ASPECTJ approach, let

setRecipientAddress readRecipientAddress us consider a system during its execution. At

modifyAttributesg readSenderAddress each moment, the system evolves toward new The delegate filter specifies that all messages, states while generating new facts and events like i. e. those having passed filter err,gotothe an access to, or change of a variable value, a

kernel without changing their selectors. method call, execution or return, etc. All these points observable points called Join represent 3. The AspectJ Metamodel a base code breaking points where aspects can get involved. Everything happens as if the ex- ecution of the base code was interrupted in the 3.1. Principle and Goals join points, giving a way to the aspect code to execute and enforce the concern purposes. Authors of this approach consider that the code Among all join points, only a subset may inter- of a given software system contains a base code

est a given aspect. The aspect source code speci-  part i. e. the business logic and a concerns part. The former consists of objects that achieve fies its meaningful join points using . functionalities of the system, whereas concerns Pointcuts are particular forms of predicates that are made of code that crosscut functionalities, use boolean operators and specific primitives like transaction management and synchroniza- to capture join points and dynamic contextual tion. In the object-oriented paradigm, concerns information. are scattered throughout the source code, con-

Several aspects can exist in the same software  sequently a tangling arises 12 .

system and be concerned by the same join points  The AOP approach of ASPECTJ 13 proposes: and the same pointcuts. In this case, aspect must

To remove this tangling by separating the be composed using some precedence rules. two parts of a software system: base objects

and concerns which are called aspects. The aspect code is divided into blocks called

advices. They are method-like mechanisms To weave the two parts by a tool called Weaver to get the executable code. The used to declare that a certain code should exe- weaving is done using principled points of cute when join points in some are cap- the code execution. tured. Three possible relationships, that deter- mine the advice type, bind advices to pointcuts:

Hence, the vision motivating AOP is that one

after around before, and . Thus, if a pointcut could provide independent specifications for

is a call to a method m, then concerned as- each concern and functionality, and then weave pects must specify a pointcut that captures the them together to build the resulting system. The AOP approach is appropriate for a wide range call and an advice that executes be- of applications. It presents undeniable advan- fore or after the call of m and even around it. tages in all applications where security, syn- The around advice can replace the call of m, chronization, transactions management, distri- as it can specify instructions that execute before bution, logging, etc, are considered as concerns and others that execute after the call. This last and separated from the system base code. AS- possibility is specified by using a special state-

PECTJ aims at better modeling real world appli- ment called proceed available only within the cations: code is smaller, less tangled and closer around advice body. Figure 3 outlines how ad- to our perception of the real world, and therefore vices preempt the normal execution flow ac- enhances reuse, evolution and maintenance. cording to the advice type. Figure 3a shows an

118 From Composition Filters to AspectJ: A Platform Specific Model Transformation a

example of two objects where the method m Figure 3b introduces an aspect that intercepts

o m o AdB of object calls the method of object . the call to m and executes some advice and then resumes the call. Figure 3c shows an aspect that intercepts the control flow after the Call and return

Object o1 Object o2 call to m is achieved and executes some ad- … … Capture of the call or return

method m1(…) n method m2(…) vice AdA. In figure 3d, the aspect intercepts the { … { … Possible call or return

o2.m2(…) … S call to m, executes some statements ,re- … … Previous call or return

… }

 proceed o sumes the call to m using and } n…r Chronological order

before returning to m, it executes some other a – Base code without aspects

statements S.

Object o1 Object o2 Aspect a1 … … … method m1(…) method m2(…) o Pointcut p() ASPECTJ provides a rich set of primitive point- { … { … … o2.m2(…) n … Before p() cuts to specify join points within an aspect. Ta- … … … … } … // Advice AdB q ble 3 summarizes the predicate meaning of those } … p primitives and their composition. b – Base code and an aspect using a before advice

Object o1 Object o2 Aspect a1 One of the strengths of advices is that they can … … … method m1(…) n method m2(…) Pointcut p() access the dynamic contextual information ex- { … { … …

o2.m2(…) … After p()

context ex posed by join points this is called … … …

… o } … // Advice AdA  p posure } … . For example, pointcuts can capture q the parameters and the target object of a call. c – Base code and an aspect using an after advice For this purpose, we can specify along with advices and pointcuts, parameters that will be Object o1 Object o2 Aspect a1 … … o … bound to values of the current join points. More- method m1(…) n method m2(…) Pointcut p() { … { … p … o2.m2(…) … around p() over, pointcuts can have an important descrip- … … … // Statements S1 … } q proceed() tive power by using the wildcard “*” instead of } … // Statements S2 r a type, a method, a parameter or as a part of a d – Base code and an aspect using an around advice name. In the same way, “..” is used to spec-

ify one or more parameters and “” to include Fig. 3. Alteration of the control flow by an advice. subtypes of a class within a specification.

Program Comments public class ComputeFactorial { public static long factorial(int n) { Class ComputeFactorial uses the factorial()method to compute recursively the if (n==0) return 1; factorial of an integer n. else return n*factorial(n-1);} } public aspect Optimizer { The first pointcut of this aspect captures calls of factorial() along with its integer pointcut factOp(int n) : argument. call(* *.factorial(int)) && args(n); pointcut firstCall(int n) : factOp (n) Captures only non-recursive calls of factorial() among those of pointcut factOp(). && !cflowbelow(factOp (int)); Ignoring recursive calls using !cflowbelow() allows us to cache only the final result. private Cache fCache = new Cache(); fCache is an object of class Cache that consists of a list of pairs (int,long). The method /* fCache is private, only this aspect have get(int) returns a cached value and put(int,long) puts a value in the cache at a position access to it */ corresponding to the first argument. To save space, this class is not shown. before(int n) : firstCall (n) { This before advice checks if the argument of the call is bigger than 50 then calls if (n >50) bigValue();} bigValue() which raises an exception. For short, this method is not shown. long around(int n) : factOp (n) { This around advice captures the call then checks the cache for the result value and return it if long val = fCache.get(n); found. When not found, proceed(n) resumes the normal computation flow. Notice that if (val != null) return val; when proceed() is not executed, the following advice (i.e. after returning) is ignored. return proceed(n); } after(int n) returning(long result) : This after returning advice captures the value returned at the end of the execution of firstCall (n) { fCache.put(n, result); factorial(). It specifies an argument to collect the return value in the returning() part. }} Then, it uses the context collected from the join point to update the cache.

Listing 3. Optimizing a computation by an aspect. From Composition Filters to AspectJ: A Platform Specific Model Transformation 119

The last concept of ASPECTJisthe static the result value and returns it if found. When

crosscutting which modifies a model at com- the result is not in the cache, the normal com- pile time. For example, ASPECTJ allows spec- putation flow is resumed. Notice that we can ifying new members that are associated with do the same thing by adding optimization code

other classes, as well as specifying what a class in the class ComputeFactorial, but such an im-

extends or implements. The former is called plementation will tangle the optimization logic

intertype member decla introduction or with factorial computation logic. By using ration. Introductions allow an aspect to spec- an aspect, the optimization code is completely ify the concerned classes by using a prefix in the separated from the factorial computation code. member declaration statement. When present, This allows us to change the caching strategy the prefix indicates one or more classes; other- without affecting the ComputeFactorial class. wise the declared member is local to the aspect.

3.3. Example 4. Motivations

Listing 3 shows an example of an aspect,adapted  from 15 , that optimizes the factorial compu- Aspect orientation and MDA can be related in tation. First, we have a simple class with a various ways: such as considering aspects and

method called factorial which computes re- business logic as two kinds of models or con-

cursively the factorial of an integer passed as an sidering that a model is made up of aspects and  argument. Second, the aspect captures calls some business logic, and so on 21 . The intent

to factorial and caches the computed val- of this article is not to specify the aspect ori-

ues for latter use. Now, each time we want to entationMDA relationship, but rather to focus

compute a factorial by calling factorial,the on the transformation of two AOP approaches aspect captures the call and checks the cache for within the MDA context.

Pointcut Corresponding predicate value (cjp stands for one of the current join points) Comments call(S) True if cjp corresponds to a call to S S ::=ResultType ClassName.MethodName (Parameters) to specify a method or execution(S) True if cjp corresponds to an execution of S ClassName(Parameters) to specify a constructor get(S) True if cjp corresponds to an access to S S ::= Type ClassName.FieldName set(S) True if cjp corresponds to an assignment to S initialization(S) True if cjp corresponds to the execution of the initialization of an object in S S ::= ClassName(Parameters) Parameters are those of the first preinitialization(S) True if cjp corresponds to the execution of the pre-initialization of an object in S constructor. Initialization includes the super constructor call staticinitialization(S) True if cjp corresponds to the execution of the initialization of class S S ::= ClassName handler(TP) True if cjp corresponds to the handling of the TP exception inside a catch bloc TP specifies the exception type within (TP) True if cjp corresponds to the execution of a code belonging to TP TP is a class name withincode(S) True if cjp corresponds to the execution of a code defined in a method or constructor specified by SS is a method or constructor signature cflow(P) True if cjp is in the control flow of the join point defined by P (including P itself) P is a pointcut cflowbelow(P) True if cjp is in the control flow below the join point in P (excluding P itself) adviceexecution() True if the executing code belongs to an advice True if cjp corresponds to the execution of a code belonging to the object defined by TP or Id (the this(TP or Id) object being the current object referenced by this in JAVA) TP is a class name and Id an identifier. target(TP or Id) True if the target of cjp is an object specified by TP or Id ‘..’ replaces any number of parameters args(TP or Id or ‘..’) True if the arguments of cjp are instances whose type is specified by TP or Id if(BoolExp) True if BoolExp is true BoolExp is a boolean expression ! P True if P is not satisfied P1 && P2 True if both P1 and P2 are satisfied P, P1, and P2 are pointcuts P1 || P2 True if P1 or P2 or both are satisfied (P) True if pointcut between the brackets is satisfied

Table 3. Predicate meaning of the primitive pointcuts and their composition. 120 From Composition Filters to AspectJ: A Platform Specific Model Transformation

Although CF and ASPECTJ are grouped within deals well with timing constraints and concur-

   a same category i. e. AOP approaches they rency using wait and real time filters 2 .In are different and both have strengths and weak- contrast, ASPECTJ is better when dealing with nesses. We summarize some of their features in applications that need optimizing some com- the following. putations, handling exceptions and field access control which are concerns we usually find in Description style. The CF allows expression financial transaction systems, distributed sys-

of filters using a declarative style that is easy to  tems, etc 9, 15 . However, in many cases ap- understand and work with. In contrast, ASPECTJ plications have several kinds of aspects which has a procedural style, like JAVA , that is based justify the use of multiple AOP approaches. on several new constructs to express concerns. The CF style is useful when dealing with dele- Since CF and ASPECTJ are different and since

gation of messages and substitution. However, metamodels influence the modeling task and the  when more complex computations are needed, perception we have of the real world 8 ,itbe- the ASPECTJ advices are better than the CF meta comes advantageous to use them both to capture filter since they have a direct access to the dy- the real world subtle situations. This conclusion namic contextual information. is the starting point of an ongoing work that aims to construct an MDA environment where Separation among concerns. In CF each filter software developers can use multiple AOP ap- in the filter set describes one concern. However, proaches at the same time and freely switch in some cases, two or more filters are combined from one to another using automated tools that to describe one concern. Consequently, a CF preserve the concerns’ traceability. interface tends to describe concerns from the class point of view, i. e. the filter set gives all the concerns where the class is involved. In contrast, an aspect in ASPECTJ may describe a PIM concern that involves several classes i. e. a con- … cern point of view. When modeling a system, we need the two points of view since sometimes PIM we may focus on an isolated concern and some- CFC Business logic AC times we may focus on how concerns compose for a given class. Transformation model Transformation model (CF platform model, (AspectJ platform The join point model.ASPECTJ, is provided rules, templates, …) model, rules, …) with a wealthy join point model that allows as- CFSM1 ASM1 pects to capture calls, access or modification of CF-To-AspectJ AspectJ-To-CF fields, exception handling and to specify con- Transformation model Transformation model cerns in various ways. On the opposite, CF intercepts only the incoming and outgoing calls. AC ASM2 CFSM2 CFC

The synchronization. While ASPECTJ adopts AspectJ Concerns CF Concerns the JAVA synchronization mechanism,the CF of- integration model integration model fers a specific filter that allows the description of ASM3 CFSM3 various synchronization concerns without deal- ing explicitly with the wait and the notify of threads. Fig. 4. Software development scenario. According to the previous, concerns that are better expressed in CF are security, synchro- Within this MDA environment, the software de- nization and timing constraints, while concerns velopment scenario is depicted in Figure 4 as a that are better expressed in ASPECTJ are opti- cascade of PIM to PIM transformations, PIM to mization and general control of computations, PSM transformations and PSM to PSM transfor- and control of access operations to object fields. mations. At the top, we find a use case PIM that Broadly speaking, CF is more appropriate for highlights aspects of the system corresponding real time and concurrent applications since it to the user view. Then, the use case PIM is From Composition Filters to AspectJ: A Platform Specific Model Transformation 121

transformed likely through a cascade of trans- PIM

formations  to extract objects, classes and con- cerns and get a PIM that expresses some busi- … ness logic along with concerns that are platform independent. These concerns can be divided PIM into two sets: concerns that are better expressed

Transformation noTransformation 

in CF CFC and concerns that are better ex- model model  pressed in ASPECTJ AC .

In the next step, we get a CF specific model CFSM p ASM

   CFSM1 or an ASPECTJ specific model ASM1 CF-To-AspectJ by transforming the PIM using CF resp. AS- Transformation model

PECTJ platform model, a set of rules, templates,  etc. When the first CFSM resp. ASM is ob- Fig. 5. Example of development scenario. tained, one can transform it to get ASM2 resp.

CFSM2  using the CF-To-ASPECTJ transforma-  tion resp. ASPECTJ-To-CF transformation and

then add concerns that are better expressed in According to Figure 5, one can get the ASM

2  ASPECTJ resp. in CF to get the final PSM using the transformation labeled or through

1  ASM3 resp. CFSM3 . transformation followed by transformation

3 . This last, which is our concern, is useful in For example, consider an Email server system the following cases: consisting of several services; one thread per

user and a database where each user emails We have the CFSM and want to get the ASM, are stored. In this type of application we can unfortunately there is no PIM from which it describe the synchronization concern between can be generated. This situation is still fre-

threads using CF and the exception handling quent today. Indeed, the MDA well-defined  concern transmission errors, timeouts, etc us- style is not always followed and software ing ASPECTJ. developers still take a PSM-only approach Obviously, using the most suitable metamodel where platform specificities are considered each time means that developing a whole sys- from the early development phases, and sep-

tem will involve several metamodels and trans- arately defined models are not used i. e.  formations to get the final PSM. This drawback PIM and PSM 8 . Notice, in this case, that

can be reduced by using automated tools and by concerns are directly described in the PSM  preserving the traceability. In our context, pre- CFSM or ASM . serving traceability is a challenging task since We would like to change the AOP platform

it means preserving a one to one correspon-  e. g. ASPECTJ instead of CF , but at the dence between the CF concerns and ASPECTJ same time we do not want to spend an impor- concerns. To achieve this goal, we need to tant effort in developing the transformation convert concerns in CF models using as much from the PIM to the new PSM. Since the two as possible only concepts dedicated to express PSMs are relatively close, the PIM becomes concerns in ASPECTJ and vice versa. useless and the ASM is advantageously gen- Allowing the use of CF and ASPECTJ metamod- erated from the CFSM. els during the development of a system is the The third motivation of this work lies in our con- first and the main motivation of this work. As fidence that through such PSM to PSM transfor- a first step towards this ideal, this article is lim- mations and by preserving traceability, one can ited to only one way transformation of the CF deduce common features of AOP approaches. models into ASPECTJ. These features are potential candidates for an The second motivation arises from the fact that a AOP metamodel to build AOP PIMs. To the transformation between two PSMs of the same best of our knowledge, an AOP metamodel to abstraction level is useful in some cases. To express AOP PIMs does not exist yet and we are understand this, let us consider the scenario of currently investigating this subject in another re- Figure 5. search. 122 From Composition Filters to AspectJ: A Platform Specific Model Transformation

5. CF to AspectJ Transformation ASPECTJ. For this sake, we keep the base code classes of the CF model unchanged and trans- 5.1. Overview form the CF interfaces using aspects, advices, pointcuts and static crosscutting.

In the MDA context, the transformations can be The transformation we propose consists of two  from PIM to PIM, PIM to PSM, PSM to PSM processes Figure 7 : or PSM to PIM, and several approaches can be A normalization that aims to put the filters in

used for transforming models such as the mark a canonical form which facilitates the trans-

model transformation meta

ing,the ,orthe formation.

transformation  

model ,etc see 14, 18 for more details. A translation using a syntax-directed ap- proach and transformation templates. It con- In this work, we propose a PSM to PSM meta- sists of generating a set of aspects using a model transformation which can be illustrated syntax-directed approach guided by a set of using the MDA transformation representation templates that preserve the CF semantics. of Figure 6. The transformation model consists

of a set of normalizing rules and transformation Notice that some concepts of CF like realtime  templates seeFigure7 . filter are currently outside the proposed trans- formation. The reasons motivating this restric- Since CF and ASPECTJ are both extensions of tion are given in subsection 5.5. JAVA , the transformation can be done by con- verting the CF concepts using the JAVA part of In the remainder of this section, we will illus- ASPECTJ. But, when doing so, we achieve a sim- trate the transformation using the example of ple weaving that does not preserve the traceabil- listing 4, which includes four filter types and al- ity of concerns. In order to preserve the trace- most all different forms of filter elements. Some ability, we need to use, as much as possible, comments are given in the same listing. only concepts dedicated to express concerns in 5.2. Normalization

CF Model CF Metamodel language used The goal of this process is to determine all the source language accessible methods of a CF class and to put its Transformation filter elements in a canonical form that facili- Model tates the transformation. A CF interface adds

Transformation the public methods of internalexternal objects to the set of kernel class methods. In case where target language language used two or more methods have the same name, the AspectJ Model AspectJ Metamodel

one belonging to the kernel class may be in-  herited or the internal external object declared

Fig. 6. PSM to PSM metamodel transformation. first hides the others. Hence, the signature σC

 C of an object C or a class can be defined as the set of all methods accessible for incoming CF Model messages. Notice that incoming messages do

not specify internal external objects as targets. Normalizing rules Normalization But their specifications in filters impose to the CF object to deduce which target will execute

Normalized CF Model the message.

finnerm In the example of listing 4, σ A

Transformation Syntax directed

intmb intmb

templates translation innerm

intmc intmc intmc

extmdg . Methods intmb and

AspectJ Model int intmb are masked by since it is de-

clared first. In the same way extm and inner Fig. 7. Overview of the transformation. extm are masked by the . From Composition Filters to AspectJ: A Platform Specific Model Transformation 123

According to the previous, normalizing the meth- – Eliminating * within a MSPList

ods’ part in the example consists of replacing the TNTNS is equivalent to

NTNS TS NTNS fS S g

TS1 i if σT 1 i TSinnerNS

list of declared methods with its complement to TSNS is equivalent to

TNT NTS TS NTSi

is equivalent to TS1 1 i

finnerm innermg

σA i. e. σA- ,see

fS S g

if σT 1 i and σT σNT 

listing 5 . T without a substitution part, is equivalent to

TS fS S g TS1 i if σT 1 i

To put filter elements in a canonical form we – Eliminating exclusion operator:

fT S T S g

apply a set of normalizing rules so that: C 1 1 i i is equivalent to

fT S T S g C σinner 1 1 i i – Adding inclusion operator and condition:

The dispatch or meta filter elements have the

T S T S g fT S T S g

f 1 1 i i is equivalent to 1 1 i i

T S T S g

form: f 1 1 i i is equivalent to

fT S T S g

True 1 1 i i

C selectorNewTargetNewSelector

– Adding substitution part in dispatch filter elements:

SNTS NTS S is equivalent to if σinner

The wait filter elements have the form:

SNTNS NTNS

SNS is equivalent to if σinner

C Selector C

where is a condition or a – Decomposition does not apply to error filters

fT S NT NS T S NT NS g

conjunction of conditions C 1 1 1 1 i i i i is equivalent to

T S NT NS CT S NT NS

C 1 1 1 1 i i i i

fT S T S g

C 1 1 i i is equivalent to

C

T S CT S

The error filter elements have the form: C 1 1 i i

Selector Selector g f Selector

1 2 i – Ignoring target in the matching part. Also applies when Tinner

SNTNS TS inner

TSNTNS is equivalent to if σ

Selector

or C

S TS inner TS is equivalent to if σ

Filters’ normalizing rules can be grouped in – Grouping wait filter elements having the same matching part

S C S C S

C1 2 i is equivalent to

C C C gS seven categories: f 1 2 i

public class A { Inputfilters public void m1(); err : error = { cd1() Ÿ {int1.*,int3.*}, // err1 public void m2(); cd2() a! {m2}, // err2 … } {int3.mc1} } // err3 public class B { act : meta = { cd3() Ÿ {m1(ext1.md1),int1.*(ext1.md1)} } // act1 public void mb1(); sync : wait = { cd4() Ÿ {m2, int3.*}, // sync1 public void mb2(); cd3()Ÿ m2 } // sync2 … } deleg : dispatch ={ cd1()Ÿ{m1(m2), int1.mb1(int3.mc2)}, // deleg1 public class BB { cd2()a!{ext1.*}, // deleg2 public void mb1(); cd3()Ÿ{int1.*(int2.*)}, // deleg3 public void mb2(); cd4()Ÿ{inner.*(ext1.*)} } // deleg4 … } } public class C { public void mc1(); Comments public void mc2(); err1: When cd1 is true, calls to the methods of int1 and int3 are accepted and pass to filter public void mc3(); act. … } err2: When cd2 is true, all messages are accepted except m2 of the kernel public class D { err3: Calls of mc1 in int3 are unconditionally accepted public void m1(); act1: When cd3 is true, the calls of m1 in the kernel are reified and passed as argument to md1 in public void m2(); ext1, and when cd3 is true, calls to methods of int1 are reified and passed as argument to md1. public void md1(); sync1: Causes the calls to m2 in the kernel to be blocked until cd4 and cd 3 become true. The calls … } of all methods in int3 are also blocked until cd4 becomes true. class A interface { deleg1: When cd1 is true, calls of m1 in the kernel are dispatched to m2 a nd calls of mb1 in //A is the kernel are substituted by and delegated to object internals int1 mc2 int3. public B int1; deleg2: When cd2 is true, all calls except those where target is ext1 are dispatched without public BB int2; substitution. This means that calls to md1 are not dispatched. The other methods, m1 and m2 in ext1, public C int3; are not in the scope of incoming messages, since they are hidden by m1 and m2 of the kernel class A. externals deleg3: When cd3 is true, the calls to methods of int1 are delegated to int2 without any public D ext1; substitution. conditions deleg4: When cd4 is true, all the calls to the kernel methods (m1 and m2) are dispatched to the private boolean cd1(){…} external object ext1 without substitution. private boolean cd2(){…} private boolean cd3(){…} Remarks: For brevity, methods do not return values and only the public methods are shown private boolean cd4(){…} The wild card ‘*’ always matches the target or selector in the matching part and does not modify the target methods or the selector when specified in the substitution part. void m1(); void m2(); When the target is omitted, the kernel object is considered instead. When a condition is missing, true is assumed instead.

Listing 4. Example of a CF model. 124 From Composition Filters to AspectJ: A Platform Specific Model Transformation

When applying the normalizing rules to the ex- One aspect for each filter in the input filter ample in listing 4, we get the results shown in set. listing 5.

One aspect composed of inter-type mem-

bers’ declaration introducing internalexter- methods void mb1(); void mb2(); void mc1(); nal instance variables and public methods void mc2(); void mc3(); void md1(); into the kernel class. These public methods Inputfilters err : error = { have an empty implementation body since cd1()Ÿ {mb1, mb2, mc1, mc2, mc3}, // err_1 the corresponding calls will be captured by cd2()Ÿ {m1, mb1, mb2, mc1, mc2, mc3, md1}, // err_2 aspects and delegated to internalexternal trueŸ mc1 } // err_3 act : meta = { objects.

cd3()Ÿ m1(ext1.md1), // act_1

kernel Final cd3()Ÿ mb1(ext1.md1), // act_2 One aspect called to capture cd3()Ÿ mb2(ext1.md1) } // act_3 calls that are not dispatched and raise a cor- sync : wait = { {cd4(), cd3()} Ÿ m2, // sync_1 responding exception. cd4()Ÿ mc1, // sync_2 cd4()Ÿ mc2, // sync_3 cd4()Ÿ mc3 } // sync_4 deleg : dispatch ={ Normalized CF Model cd1() Ÿ m1(inner.m2), // deleg_1 cd1() Ÿ mb1(int3.mc2), // deleg_2 Java interface / CF interface cd2()Ÿ m1(inner.m1), // deleg_3 Java class cd2() m2(inner.m2), // deleg_4 Method Internal / Ÿ Filter External cd2()Ÿ mb1(int1.mb), // deleg_5 cd2()Ÿ mb2(int1.mb2), // deleg_6 cd2()Ÿ mc1(int3.mc1), // deleg_7 cd2()Ÿ mc2(int3.mc2), // deleg_8 cd2()Ÿ mc3(int3.mc3), // deleg_9 Java interface / Aspect kernel_Final cd3()Ÿ mb1(int2.mb1), // deleg_10 Java class cd3()Ÿ mb2(int2.mb2), // deleg_11 Corresponding Introductions Aspect Aspect cd4()Ÿ m1(ext1.m1), // deleg_12 cd4()Ÿ m2(ext1.m2) } // deleg_13 AspectJ Model CF interface counterpart

Keep elements Translate using Listing 5. Normalized methods and input filters parts. unchanged transformation templates

Fig. 8. The structure transformation schema. 5.3. Transformation Templates The content of these aspects is determined using Valid transformation changes the structure of the transformation templates given in the rest of

the original model, but preserves its behavior this subsection. Listing 6 shows the resulting  i. e. its semantics . Recall that a CF model is a model when applying the structure transforma- set of ordinary JAVA interfaces and JAVA classes tion schema to the example of listing 5. where some are provided with CF interfaces. Therefore, the overall structure transformation Aspects that correspond to filters are composed

of the CF model is to keep unchanged ordinary of advices. For example, a normalized FE

SNTNS JAVA classes and JAVA interfaces while translat- C in a filter maps to an advice in ing CF interfaces into aspects. Consequently, the corresponding aspect. This advice is of themaintransformationtaskistofindwhat type around and has three anonymous point-

corresponds to each CF interface. cuts i. e. unnamed pointcuts directly declared call in the advice. The first pointcut is

Since the CF interface represents several con- innerS which captures calls to method cerns, it translates to several aspects. We pro- S in the inner class the first wildcard means pose the structure transformation schema of Fig- any access modifier and the second any return ure 8.

value type. The second and third pointcuts are argsparameterList According to Figure 8, the JAVA interfaces and targetobj and . They classes are kept unchanged in the ASPECTJ model make available the target object and arguments while each CF interface has a counterpart con- of the call within the advice body which uses sisting of: them to perform its computation. From Composition Filters to AspectJ: A Platform Specific Model Transformation 125

public class A { public void m1(); These constraints can be expressed in terms of public void m2(); … } filter element accept or reject effects on the con- public class B { public void mb1(); public void mb2(); … } trol flow of a message according to the filter public class BB { public void mb1(); type, the position of the filter element within public void mb2(); … } public class C { public void mc1(); the filter and the position of the filter within the

public void mc2();  filter set see Table 4 . public void mc3(); … } public class D { public void m1(); public void m2(); public void md1(); … } Current Is current Is current Effect on the message flow privileged aspect A_Introd { Filter FE FE the filter the last within a normalized input filter declare precedence A_err, A_act, A_sync, A_deleg, A_final; Type handler last FE in filter in the set public B A.int1; Action the filter? filter set? public BB A.int2; No Pass to next filter public C A.int3; Accept No/Yes public D A.ext1; Yes Raise an exception public boolean A.cd1(){…}; No No/Yes Pass to next filter element public boolean A.cd2(){…}; Error Reject public boolean A.cd3(){…}; Yes No/Yes Raise an exception public boolean A.cd4(){…}; If m() executes Continue or public void A.mb1(){}; send, then pass to next filter No public void A.mb2(){}; m() is the method to which the Accept No/Yes public void A.mc1(){}; reified message is sent public void A.mc2(){}; If m() executes Continue or send, Yes public void A.mc3(){}; then raise an exception public void A.md1(){}; Meta } No No/Yes Pass to next filter element privileged aspect A_err { …} // See listing 7 Reject No Pass to next filter privileged aspect A_act { …} // See listing 8 Yes Yes Raise an exception privileged aspect A_sync { …} // See listing 9 privileged aspect A_deleg { …} // See listing 10 No No/Yes Pass to next filter element aspect A_final { …} // See listing 11 Accept No Pass to next filter Yes Yes Raise an exception

Wait Block the message then pass the Listing 6. Transforming the structure of the CF model. No Reject No/Yes current filter again YesRaise an excepti on Dispatch the message. Ignore Accept No/Yes No/Yes remaining filter elements and Preserving the CF semantics is a challenging filters

task. If we consider a filter set FS where each No No/Yes Pass to next filter element FElem filter F is composed of filter elements , Reject No Pass to next filter Dispatch Yes then preserving the CF semantics means: im- Yes Raise an exception

plementing the accept and reject effects of each F FElem on messages and on the filter , and im- Table 4. Effect of filter element handler actions on the

plementing the accept and reject effects of each message flow. FS filter F on messages and filter set . Particularly, the following constraints must be To enforce constraint 1 in ASPECTJ, we de- satisfied: clare precedence between aspects. The aspect corresponding to the first filter will dominate 1 A message passes once through each filter in the filters set and each FE in an order that the aspect corresponding to the second that will corresponds to their declaration. Up-down dominate the aspect corresponding to the third for filter set and from left to right for filter and so on. The FEs’ order is enforced by declar- elements. ing the corresponding advices in the same order of the FEs in the filter.

2 According to the filter type, the filter ele- ment handler action may affect the message To enforce the second constraint, we remark flow. After a dispatch, a final reject or reifi- that since to each FE corresponds an advice, cation, the remaining FE and filters are no ignoring the remaining FEs and filters in case longer considered. In the case of a wait fil- of a dispatch or reject comes to inhibiting their ter, each time the message is blocked by a corresponding advices. ‘Inhibiting’ means at- filter element, it passes the filter again. taching a condition to an advice, to preclude

its execution. For this sake, we have added a 3 A message must be dispatched by the filter class, called List, whose objects are inhibition

set. lists. Objects of class List contain inhibition 126 From Composition Filters to AspectJ: A Platform Specific Model Transformation elements which consist of a join point identifier, for the absence of inhibiting elements before a target object identifier and a string that spec- proceeding. ifies if the inhibition concerns the whole input Advice handles the inhibition list by three meth-

filter set or only a given filter.

removeInhibition in ods, inhibit, and

hibited, which respectively inserts, removes When processing a filter element, CFE,which elements, and tests for the existence of elements causes the filter F to accept a message and skip in the list. The reflexive features of JAVA and the remaining FEs in F, the advice correspond-

ASPECTJ allow us to know, at any time, the cur-

joinpoint id ing to CFE inserts an element

rent join point and current object unique identi-

id filterName target in the inhibition

list. In the case of a dispatch or reification with fiers by using thisJoinPoint.

joinpoint id

reply, the inserted element is Notice that a form of inhibition already exists

idfilterSet target which inhibits all in ASPECTJ for advices of type around. In- the remaining advices and aspects correspond- deed, when an around advice executes, it pre- ing to the filter set. All advices must check cludes the execution of all other advices of lower

Aspect corresponding to Error filter err Comments privileged aspect A_err { The aspect name is composed of the kernel class name and the filter object around (): … { …} // corresponds to err_1 name. object around (A obj): // corresponds to err_2 (call(* * A.m1(..)) || call(* * A.mb1(..)) || Anonymous point cuts corresponding to the matching part. call(* * A.mb2(..)) || call(* * A.mc1(..)) ||call(* * A.mc2(..)) || This around advice tests if all the aspects corresponding to the filter set call(* * A.mc3(..)) ||call(* * A.md1(..))) &&target(obj) { have not been inhibited by a previous aspect, that advices of A_err if ((! list.inhibited(tjp, obj, “filterset”)&& have not been inhibited by a previous advice and that cd2() is true. If (! list.inhibited(tjp, obj, “A_err”)) && so, the call is accepted and the remaining advices in A_err are cd2()){ list.inhibit(tjp, obj, “A_err”); inhibited. The proceed() allows the call to pass to other advices. tjp } stands for thisJoinPoint. return proceed(); } object around (): … { …} // corresponds to err_3 object around (A obj): call(* * A.*(..)) && target(obj) { At the end of the aspect, an advice is added to raise an exception if the if (!list.inhibited(tjp, obj, “A_err”)) raiseException(); call has not been accepted by the previous advices in A_err. If the call else { list.removeInhibition(tjp, obj, “A_err”); has been accepted, the inhibition element of this aspect is removed from return proceed();} the list. The proceed() allows the call to pass to advices of next } } aspect.

Listing 7. Error filter transformation template.

Aspect corresponding to Meta filter act Comments privileged aspect A_act { The second advice tests if A_act and aspects corresponding to the filter set object around(): … { …} // corresponds to act_1 have not been inhibited and if cd3() is true. If so, aspects corresponding to this object around(A obj, paramDecl): // corresponds to act_2 filter and filter set are inhibited. (call(* * A.mb1(..)) && target(obj) && During the transformation, statements of the meta object method md1() are args(paramList) { changed and inlined within the advice body. Recall that there are three special if ((! list.inhibited(tjp, obj, “filterset”)&& statements send, reply and continue that can be applied to a reified message (! list.inhibited(tjp, obj, “A_act”))) && cd3(){ mes within meta object method. Occurrences of ‘mes.continue()’ statement list.inhibit(tjp, obj, “filterset”); are replaced with : list.inhibit(tjp, obj, “A_act”); List.removeInhibition(tjp, obj,”filterset”); … return proceed(paramList); … // inline here instruction of md1() Occurrences of ‘mes.reply(expression)’ are replaced with: } else return proceed(); return expression } Occurences of ‘variable = mes.send()’ are replaced with: } List.removeInhibition(tjp, obj,”filterset”); variable = proceed(paramList) object around(): … { …} // corresponds to act_3 Notice that access to the arguments paramList can be done directly since they } are not reified. Removing the filter set inhibition allows the call to pass through /* paramDecl stands for a parameter declaration list and aspects corresponding to the remaining filters. paramList for a list of parameters */ Within the advice, any reference to a field or a method of the meta object is prefixed by ‘this.ext1.’

Listing 8. Meta filter transformation template. From Composition Filters to AspectJ: A Platform Specific Model Transformation 127

Aspect corresponding to Wait filter sync Comments privileged aspect A_sync { The overall transformation consists of adding a new class called Lock, having two private Lock A.l_cd4_cd3; synchronized methods block() and wakeup() whose role is respectively to block private Lock A.l_cd4; threads using the JAVA wait() statement and resume them using the JAVA notifyAll() object around (A obj): // corresponds to sync_1 statement. call(* * A.m2(..))&& target(obj) { We attach a lock to each condition or conjunction of conditions in a filter element. if ((! list.inhibited(tjp, obj, “filterset”) { Each call to a message that matches a FE in MSPList causes the thread to test the while (!(cd4() && cd3())) l_cd4_cd3.block(); condition and block repeatedly unltil the condition becomes true. } At each iteration, the thread is resumed by an after advice that captures set join point return proceed(); on any of the variables composing the condition. Then the thread evaluates the } condition again. When a thread leaves the while loop, it executes proceed() which object around (): … { …}// corresponds to sync_2 allows the advices in the remaining aspects to alter the message flow. … Notice that no filter inhibition is necessary since pointcuts in each advice concern after (): set(* A.field1) || set(* A.field2) …{ different calls (see grouping wait filter elements normalization rule). l_cd4_cd3.wakeup(); In the same way, the filter set is not inhibited since wait filters do not alter the message } flow but just delay it. after (): set(* A.field2) || set(* A.field4) …{ field1, field2, etc are assumed to be the fields that appear in the method bodies of cd4() l_cd4.wakeup(); and cd3(). Notice that these fields can be determined by parsing cd4 and cd3 condition } methods. }

ll Listing 9. Wait filter transformation template.

Aspect corresponding to Dispatch filter deleg Comments privileged aspect A_deleg { object around(): … { …} // corresponds to d eleg_1 An around advice inhibits all the remaining around object around(A obj, param Decl): // corresponds to deleg_2 advices unless proceed is used. Thus two cases are call(* * A.mb1(..)) && target(obj) && args(paramList){ possible. In the first, when the message is to be if ((! list.inhibited(tjp, obj, “filterset”) && cd1()) { dispatched to the kernel object with the same selector, list.removeInhibition(tjp, obj, “filterset”); we use proceed() to let the message continue but, at return this.int3.mc2(paramList); the same time we need to inhibit all the remaining }else return proceed(); advices, that’s why we use list.inhibit(tjp, } obj, “filterset”). … In the second case, when message is dispatched to obje ct around(A obj, paramDecl): // corresponds to deleg_4 internal/external objects or the kernel class with a new call(* * A.m2(..)) && target(obj) && args(paramList){ selector, we remove the inhibition element which is if ((! list.inhibited(tjp, obj, “filterset”) && cd2()) list.inhibit(tjp, obj, “f ilterset”); no longer needed and then delegate the message. The return proceed(); remaining advices are implicitly inhibited since we do }… } not use proceed().

ll Listing 10. Dispatch filter transformation template.

precedence concerned by the same join points, aspect A_Final {

except when proceed is used. In this case, object around(A obj): call(* * A.*(..)) && target(obj) { if ((! list.inhibited(tjp, obj, “filterset”) raiseException(); the next advice with the highest precedence is else { list.removeInhibition(tjp, obj, “filterset”); executed. In our transformation, we rely on return proceed(); } the ASPECTJ inhibition whenever possible and }} /* raiseException is a method that throws a NotDispatched exception */ use proceed whenever we want to avoid it. In listings 7 to 10, we take a closer look to the transformation templates of each filter type. For Listing 11. Contents of the kernel final aspect. clarity sake, we use the normalized filter exam- ples of listing 5 rather than a specific formal template language. 5.4. The Syntax-directed Transformation

Finally, to enforce constraint 3 , we add a spe- Final cial aspect called kernel with only one The second process in the transformation con- advice that captures any call to the kernel class sists of translating the normalized CF models

and raises an exception unless it is inhibited see into ASPECTJ. For this sake, we use the syntax-

 listing 11. directed translation approach described in 1

128 From Composition Filters to AspectJ: A Platform Specific Model Transformation

f j g f j g

and the transformation templates given in 5.3. A α β and A χ δ represents two

  

Formally, a syntax-directed translation schema rules A α,A χ and A β,A δ .  isa5-tupleTN, Σ, Δ,R,S where: Words beginning by $ are directives used to lo- – N is a finite set of nonterminal symbols calize positions in the translated model where – Σ is a finite input alphabet additional statements are inserted. The state-

– Δ is a finite output alphabet ments corresponding to each directive are given

– R is a finite set of pairs of rules having the form A α, in Table 5. 

A β where the first is a derivation rule and the second is



the corresponding translation element. A N, α N Σ *

 and β N Δ *. α and β are strings composed of terminals and nonterminals so that the nonterminals in β are a permu-

tation of the nonterminals in α. is the derivation symbol 5.5. Scope of the Transformation

and is the translation symbol.

– S is a distinguished nonterminal in N called start symbol Concerning the transformation of the CF mod-

 MM

When transforming a model M having as els to ASPECTJ, we have proposed an approach

M  MM

a metamodel  to another model with as that covers all CF interface constructs includ- Realtime a metamodel , the syntax-directed translation ing four filter types. Currently, the is used as a method of transforming derivation filter type is not supported since ASPECTJ does

trees in the input metamodel MM into deriva- not provide specific concepts to deal with tim-

tion trees in the output metamodel MM.Given ing constraints. Building a real time executive x an input sentence x, a translation for is ob- subsystem in ASPECTJ is possible, but it will be

tained by constructing a derivation tree for x, mainly based on JAVA . then transforming the derivation tree into a tree CF has rich syntactical forms to specify filters. in MM, and then taking the frontier of the output Even if some forms have not been considered in tree as a translation for x. The transformation the given examples, they can be normalized and of a normalized CF model can be characterized the same transformation applied. Output filters by the set of rules given in Table 6, which in- are not covered by the transformation for the clude the structure transformation schema and reasons given in 2.2, but we expect that most of the templates. Sets N, and are defined as Σ Δ the proposed transformation can be reused. Su- follows.

perimposition, which is a technique introduced

f g

–N ENTITY,REMAINDER,CFINTERFACE, CD, VD, :



all words given in small capital letters in CF to deal with systemic crosscutting see 6



f 

– Σ  class, interface, internals, conditions, , , for more details , is not covered. This is due to g (, ), : all keywords and terminal symbols used in CF are the lack of complete and well documented se-

given in bold typeface mantics and the lack of an implementation that f

– Δ  class, interface, aspect, privileged, pointcut, before, g after, around, inhibited, obj, (, ), : all keywords and covers CF features and superimposition in the terminal symbols used in ASPECTJ are given in bold typeface same time. The last implementation of CF i.

In Table 6, strings in italic typeface are in- e. extension of the Microsoft DotNet platform   serted, as they are, in the generated model and does not support superimposition 6 . ‘ ’ indicates a concatenation. The notation

Instead of Insert 6. Related Work $Precedence Precedence declaration statement $LastAdvice Advice of listing 11, with $Kernel instead of A Although AOP and MDA are powerful para- $EndFilterError The last advice of listing 7 with $Kernel instead of A digms, they are still relatively new and little $EndFilterWait After advices of listing 9 with $Kernel instead of A and variables used in filter element conditions instead has been done in relating them. Most related of field1, field2, … work deal with model transformations or the $Kernel The name of the kernel class role of AOP in MDA. However, to the best of $ParamDecl List of parameters of the concerned method along our knowledge, there is no attempt in transform- with their types ing one AOP approach using another within the $ParamList List of parameters of the concerned method $MetaMethod The body of the corresponding meta method after its MDA context and even outside it. In the follow- transformation according to listing 8 ing, we first present a work on the taxonomy $Locks As many lock declarations as conditions in the of model transformation approaches, then we considered wait filter present works dealing with the transformation $LockName The name of the lock corresponding to the condition $Filter The name of the corresponding filter of AOP approaches and finally we present some works dealing with the role of AOP in MDA. Table 5. Directives and their corresponding codes. From Composition Filters to AspectJ: A Platform Specific Model Transformation 129

Production rule Corresponding translation element S o ENTITY REMAINDER S{ ENTITY REMAINDER REMAINDER o ENTITY REMAINDER REMAINDER { ENTITY REMAINDER ENTITY o®JAVACLASS | JAVAINTERFACE |CFINTERFACE¾ ENTITY {®JAVACLASS | JAVAINTERFACE | CFINTERFACE¾ CFINTERFACE o class IDENTIFIER interface { INTERNALSPART CFINTERFACE { aspect IDENTIFIER_Introd { $Precedence INTERNALSPART EXTERNALSPART CONDITIONSPART METHODSPARTS EXTERNALSPART CONDITIONSPART METHODSPARTS } INPUTFILTERPART INPUTFILTERPART } aspect IDENTIFIER_Final {$LastAdvice } INTERNALSPART o internals VARIABLEDECL INTERNALSPART { VARIABLEDECL VARIABLEDECL o®VD | VD; VARIABLEDECL¾ VARIABLEDECL {®VD | VD; VARIABLEDECL¾ VD o public TYPEIDENTIFIER IDENTIFIER VD { public TYPEIDENTIFIER. IDENTIFIER EXTERNALSPART o externals VARIABLEDECL EXTERNALSPART { VARIABLEDECL CONDITIONSPART o conditions CONDITIONDECL CONDITIONSPART { CONDITIONDECL CONDITIONDECL o®CD | CD; CONDITIONDECL¾ CONDITIONDECL {®CD | CD; CONDITIONDECL¾ CD o private RETTYPE IDENTIFIER ( ) { METHODBODY } CD { public RETTYPE IDENTIFIER ( ) { METHODBODY } METHODSPART o methods METHODDECL METHODSPART { METHODDECL METHODDECL o®MD | MD; METHODDECL¾ METHODDECL {®MD | MD; METHODDECL¾ MD o public RETTYPE IDENTIFIER ( ) MD { public RETTYPE IDENTIFIER ( ) { } INPUTFILTERSPART o inputfilters FILTERDECL INPUTFILTERSPART { FILTERDECL FILTERDECL o®FD | FD FILTERDECL¾ FILTERDECL {®FD | FD FILTERDECL ¾ FD o IDENTIFIER : FILTERSPECIF FD { privileged aspect $Kernel_IDENTIFIER { FILTERSPECIF FILTERSPECIF o FILTERSPECIF { ® error = { ERRORFEDECL } | meta = { METAFEDECL } | ® ERRORFEDECL $EndFilterError } | METAFEDECL } | wait = { WAITFEDECL } | dispatch = { DISPFEDECL } ¾ $Locks WAITFEDECL $EndFilterWait } | DISPFEDECL } ¾ ERRORFEDECL o®ERRORFE| ERRORFE, ERRORFEDECL¾ ERRORFEDECL {®ERRORFE | ERRORFE ERRORFEDECL¾ ERRORFE o CONDITION Ÿ LISTSELECTOR ERRORFE { object around ($Kernel obj): LISTSELECTOR &&target(obj) { if ((! list.inhibited(thisJoinPoint, obj, “filterset”)&& (! list.inhibited(thisJoinPoint, obj, “$Kernel_$Filter”)) && CONDITION){ list.inhibit(thisJoinPoint, obj, “$Kernel_$Filter”); } return proceed(); } LISTSELECTOR o®SELECT | {LS}¾ LISTSELECTOR {®SELECT | (LS)¾ LS o®SELECT |SELECT,LS¾ LS {®SELECT |SELECT, LS¾ SELECT o SELECTOR SELECT { call(* * $KerneL.SELECTOR (..) METAFEDECL o®METAFE | METAFE, METAFEDECL¾ METAFEDECL {®METAFE | METAFE METAFEDECL¾ METAFE o METAFE {object around($Kernel obj, $ParamDecl): CONDITION Ÿ SELECTOR (TARGET.NEWSELECTOR) (call(* * $Kernel.SELECTOR(..)) && target(obj) && args($ParamList) { if ((! list.inhibited(thisJoinPoint, obj, “filterset”)) && (! list.inhibited(thisJoinPoint, obj, “$Kernel_$Filter”))) && CONDITION { list.inhibit(thisJoinPoint, obj, “filterset”); list.inhibit(thisJoinPoint, obj, “$Kernel_$Filter”); $MetaMethod } else return proceed(); } } WAITFEDECL o®WAITFE | WAITFE, WAITFEDECL¾ WAITFEDECL {®WAITFE | WAITFE WAITFEDECL¾ WAITFE o COND Ÿ SELECTOR WAITFE { object around ($Kernel obj): call(* * $Kernel.SELECTOR(..)) && target(obj) { if ((! list.inhibited(thisJoinPoint, obj, “filterset”) { while (! COND) $LockName.block();} return proceed();} COND o®CONDITION | {LC}¾ COND {®CONDITION | (LC)¾ LC o®CONDITION |CONDITION, LC¾ LC {®CONDITION |CONDITION && LC¾ DISPFEDECL o®DISPFE | DISPFE, DISPFEDECL¾ DISPFEDECL {®DISPFE | DISPFE DISPFEDECL¾ DISPFE o DISPFE { object around($Kernel obj, $ParamDecl): call(* * $KerneL.SELECTOR (..)) && target(obj) && args($ParamList) { if ((! list.inhibited(thisJoinPoint, obj, “filterset”) && CONDITION) ®CONDITION Ÿ SELECTOR (inner.SELECTOR) | ® list.inhibit(thisjoinpoint, obj, “filterset”); return proceed(); } | CONDITION Ÿ SELECTOR (inner.NEWSELECTOR) | { list.removeInhibition(thisJoinPoint, obj, “filterset”); return this.NEWSELECTOR ($ParamList);} else return proceed(); } | CONDITION Ÿ SELECTOR (TARGET.NEWSELECTOR)¾ { list.removeInhibition(thisJoinPoint, obj, “filterset”); return this.TARGET.NEWSELECTOR ($ParamList);} else return proceed(); } ¾ CONDITION o®true | IDENTIFIER ()¾ CONDITION {®true | IDENTIFIER ()¾ JAVACLASS,JAVAINTERFACE,METHODBODY have the same JAVACLASS,JAVAINTERFACE,METHODBODY are kept unchanged syntax as those of JAVA. IDENTIFIER, TYPEIDENTIFIER, IDENTIFIER, TYPEIDENTIFIER, RETTYPE,SELECTOR,NEWSELECTOR,TARGET RETTYPE,SELECTOR,NEWSELECTOR,TARGET are lexical are lexical variables variables

Table 6. CF to ASPECTJ transformation rules. 130 From Composition Filters to AspectJ: A Platform Specific Model Transformation

Concerning model transformation approaches, into a model without extensive manual adapta-  a taxonomy is provided in 16 . The purpose tion. Compared to these attempts, our work, in of this taxonomy is to give an overview of the its current state, does not address the problems research field of model transformation and to that may arise when integrating AOP and MDA, present a framework for comparing and com- however, we suppose that an AOP PSM contains bining transformation tools, techniques and for- business logic and concerns that have been de- malisms. The authors identify a set of crite- rived from a set of PIMs without constraining ria to characterize a transformation approach their forms or contents. such as: number of source and target mod-

els, technical space of the transformation e.

  g., MDA, XML, endogenous exogenous i. 7. Conclusion

e. transformation within the same language or

  between languages , horizontal vertical i. e. Both aspect orientation and MDA are power- transformation within the same level of ab- ful paradigms whose combination is a promis-

straction or across levels of abstraction, syn- ing issue for software development and mainte-  tacticsemantic i. e. simple syntactical rewrit- nance. In this article we focused on the trans- ing or complex transformation taking semantics formation of CF models into ASPECTJ models into account, etc. According to some of these considered as two PSMs. The strength of our taxonomy criteria, our transformation approach work lies in two points: the first is that we pro- can be characterized as a horizontal exogenous pose a syntax-directed transformation for which semantic transformation in the MDA and AOP the automated tool, that constructs and traverses technical space. derivation trees, is easily implemented, second Concerning the transformation of AOP approach- is the exclusive use of concepts that extend es, most works deal with the weaving of busi- JAVA in ASPECTJ. This avoids our transforma- ness logic and concerns to get a target program tion to be a simple weaving that produces a JAVA in a pure object-oriented language. This is espe- model. The focus on how aspect-oriented con- cially the case of CF, ASPECTJ and hyperspace cepts are related enhances the abstraction level

of the transformation and preserves traceability  approach HyperJ for which the weaving pro-

of concerns between the two models.



duces a JAVA program see 11 and the special 

issue of CACM 9 . In contrast, our work deals In our future work, we will consider the in- 

with the transformation of an AOP approach verse transformation i. e. ASPECTJtoCF,

   CF using another ASPECTJ . Although this along with transformations between other SOC can be considered as a special weaving, it is, approaches. Ultimately, we will exploit these however, achieved under the strong constraint transformations to deduce high level aspect-

of preserving business logic classes unaltered oriented concepts that are platform independent.  i. e. preserving the concerns traceability .

Concerning the role of AOP in MDA, the work 8. Acknowledgment  described in 21 advocates the fact that AOP addresses a fundamental problem faced by the MDA: how to define separate models for con- We would like to thank the anonymous refe- cerns and business logic, combine those models, rees whose comments helped us to significantly

and finally generate applications from them? In improve the first version of this article.  the same way, we find in 10 a presentation showing a particular integration between Cos- mic and C-SAW. The former is a tool suite, con- References sisting in modeling languages and platform spe-

cific generative tools, dedicated to distributed  real-time and embedded systems. The latter  1 A. V.AHO ET AL, Compilers. Principles, Techniques

is an aspect model weaver which is applied and Tools, Addison Wesley, 1986.  to Cosmic models to transform them according  2 M. AKSIT,B.TEKINERDOGAN, Solving the Mod- to the characteristics of crosscutting modeling eling Problems of Object-Oriented Languages by Composing Multiple Aspects Using Composition

concerns. The authors highlight the capability Filters, AOP’98 workshop position paper, 1998.

twentenlcomposition

of the resulting environment to support quick httptresecsu filters insertremove of new properties and policies

From Composition Filters to AspectJ: A Platform Specific Model Transformation 131

  

3 M. AKSIT,B.TEKINERDOGAN, Aspect-Oriented Pro-  18 J. MILLER,J.MUKERJI, MDA Guide version 1.0.1,

gmda gramming Using Composition Filters, ECOOP’98 OMG, June 2003. httpwwwomgor

Workshop Reader, Springer Verlag, July 1998.

 

utwentenlcomposition httptresecs 19 Meta Object Facility Specification, Version

filters 1.4, Object Management Group, April 2002.

httpwwwomgorgmda 

 4 L. BERGMANS, Composing Concurrent Objects,

 

Ph.D. thesis, University of Twente, 1994. http 20 H. OSSHER,P.TARR, Multi-Dimensional Separa-

ntenlcomposition tresecsutwe tion of Concerns using Hyperspaces. IBM Research

filters Report 21452, April, 1999.

   5  BERGMANS L.,M.AKSIT, Composing Crosscutting 21 D. WAMPLER, The Role of Aspect-Oriented Pro- Concerns Using Composition Filters, Communica- gramming in OMG’s Model-Driven Architec-

tions of the ACM, Vol. 44, No. 10, pp. 51-57, ture, Aspect Programming, Inc., httpwwwas

ompapers Last

October 2001. pectprogrammingc

visited August   6 L. BERGMANS,M.AKSIT, Principles and De- sign Rationale of Composition Filters, In Aspect- Oriented Software Development, Addison-Wesley, Received: January, 2005

Revised: August, 2005

utwentenlpubli

2004. httptresecs Accepted: December, 2005

cationsfilesChapterCompFiltspdf

Contact address:   7 J. BEZIVIN´ , From Object composition to Model Transformation with the MDA, in proceeding of Djamel Meslati Laboratoire de Recherche en Informatique TOOLS’USA, Vol. IEEE TOOLS-39, Santa Bar- Universite´ de Annaba bara, August 2001. BP 12

23000, Annaba 

 8 A. BROWN, An introduction to Model-Driven Ar- Algerie´ djamelyahoocom

chitecture, Part I: MDA and today’s systems, e-mail: meslati

bmcomdeveloperworks

httpwwwi Mohamed T. Kimour

yhtml rationallibrar Laboratoire de Recherche en Informatique

Universite´ de Annaba  9  T. ELRAD ET AL., Aspect-Oriented Programming, BP 12 Special theme, Communications of the ACM, Vol. 23000, Annaba 44, No. 10, October 2001. Algerie´

e-mail: kimouryahoocom   10 J. GRAY,A.GOKHALE, Concern Separation in Sa¨ıd Ghoul Model-Integrated Computing, OMG’s First Annual Computer Science Department Model-Integrated Computing Workshop, Arlington, Philadelphia University VA USA, October 12–15, 2004. Sweilah PoBox 1101

Amman   11 E. HILSDALE,J.HUGUNIN, Advice Weaving in AS- Jordan

PECTJ, 3rd International Conference on Aspect- e-mail: sghoulphiladelphiaedu jo Oriented Software Development, pp. 26–35, April

2004.   12 G. KICZALES ET AL., Aspect-Oriented Program- DJAMEL MESLATI is the head of the research group on evolution and ming, in Proc. of ECOOP’97, Lecture Notes in reuse of software systems. His research interests include software de-

Computer Science Vol. 1241, pp. 220–242, 1997. velopment and evolution methodologies and separation of concerns.

org

httpeclipse ASPECTJ   13 G. KICZALES ET AL, An Overview of ASPECTJ, in MOHAMED T. KIMOUR is an assistant professor at the department of Proc. of ECOOP, Springer-Verlag, 2001. computer science at the University of Annaba. His research interests

include requirements engineering and model-based development of em-   14 A. KLEPPE ET AL, MDA explained: The Model- bedded real-time systems. Driven Architecture Practice and Promise, Addison Wesley, 2003.

SA¨ID GHOUL is a professor at the department of computer science at   15 R. LADDAD,ASPECTJ in action: Practical Aspect- the Philadelphia University in Amman. His research interests include Oriented Programming, Manning Publications Co., software process methodologies and programming languages.

2003.   16 T. MENS,P.VAN GORP, A Taxonomy of Model Trans- formation, International Workshop on Graph and

Model Transformation, Tallinn, Estonia, Septem-

bepub

ber 28, 2005. ftpftpumhac

ftp infofsGraMOTtaxonomypdf  17  J. MILLER,J.MUKERJI, Model Driven Architec- ture (MDA), Document number ormsc/2001-07-

01, Architecture Board ORMSC, July 9, 2001.

httpwwwomgorgmdapresentationshtm