Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Some Question of ATL
icon11.gif  Some Question of ATL [message #1755781] Wed, 08 March 2017 06:59 Go to next message
Nicholas Kong is currently offline Nicholas KongFriend
Messages: 59
Registered: July 2016
Location: China
Member
Hi Everyone,

I am the fresh user to using ATL. But now, I met some question.
If there are some one who can answer these questions, please reply me.

1) When I use ATL to write the model transformation rule, is it support to separate one ATL to many? as Java or other program language can import other rule from different file.
Because I want to use ATL to transfor a meta-model, which one has more than 100 Elements. I have had wrote almost 5000 lines for model transformation. Now, I just find how to sperate helper from one atl as libary. But does any one who knows how to separe the transforamtion rule to different file.

2) Is there any function can do like :
for(int i=1; i<*.length; i++){
index <- i
}
in ATL? Does ATL support variable defination?

3) IF I want to transfor a big model ATL, some time may be I modify some part of model, need transfor it again. Does ATL supprot incremental transformation?

[Updated on: Wed, 08 March 2017 07:33]

Report message to a moderator

Re: Some Question of ATL [message #1755793 is a reply to message #1755781] Wed, 08 March 2017 09:12 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 589
Registered: September 2012
Location: Belgium
Senior Member

Nicholas Kong wrote on Wed, 08 March 2017 07:59
1) When I use ATL to write the model transformation rule, is it support to separate one ATL to many? as Java or other


Yes, ATL supports library modules for helpers, which can be imported in the "uses" section of a module. In addition, there is module superimposition. Finally, the ATL/EMFTVM runtime provides an improved module import mechanism.

Nicholas Kong wrote on Wed, 08 March 2017 07:59
2) Is there any function can do like :
for(int i=1; i<*.length; i++){
index <- i
}
in ATL? Does ATL support variable defination?


The preferred way of programming in ATL is declarative, i.e. without variables. Your example is not ideal, because only the last assignment of "index" matters, and your code can be rewritten as follows:

index <- if *.length <= 1 then OclUndefined else *.length - 1 endif


That said, you can declaratively "do something" for each element in a collection as follows:

element.property->collect(p | calculateSomething(p))


You can compare this to Java 8 streams.

Nicholas Kong wrote on Wed, 08 March 2017 07:59
3) IF I want to transfor a big model ATL, some time may be I modify some part of model, need transfor it again. Does ATL supprot incremental transformation?


No, it doesn't. However, you can still speed up repetitive transformations by packaging your transformation in an Eclipse plugin, and then keep it loaded in memory. In addition, you can have your transformation operate directly on the model in memory (i.e. the one loaded by the editor).


Cheers,
Dennis
Re: Some Question of ATL [message #1755893 is a reply to message #1755793] Thu, 09 March 2017 04:28 Go to previous message
Nicholas Kong is currently offline Nicholas KongFriend
Messages: 59
Registered: July 2016
Location: China
Member
Dennis
Thank you. I will further reasearch what you said.
Thanks
Previous Topic:Pivot's OCL and ATL's OCL compatibility
Next Topic:How to check name attribute that contains two words
Goto Forum:
  


Current Time: Fri Apr 26 12:13:19 GMT 2024

Powered by FUDForum. Page generated in 0.03627 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top