ATL Design Patterns [message #1641415] |
Sat, 28 February 2015 10:30  |
Eclipse User |
|
|
|
Hello all,
I've started a page on the Eclipse wiki about ATL-specific design patterns:
https://wiki.eclipse.org/ATL/Design_Patterns
So far, I've added three patterns that I found useful in my experience:
- Object indexing
- Many-To-One
- Many-To-Many
If you found other patterns for yourself, please add them to this topic! We may then include them on the wiki.
[Updated on: Mon, 02 March 2015 16:58] by Moderator
|
|
|
|
Re: ATL Design Patterns [message #1650380 is a reply to message #1648193] |
Wed, 04 March 2015 15:14   |
Eclipse User |
|
|
|
Thanks! It's a simple pattern, which is good. It also allows you to customise tracing any way you like.
For safety reasons (not overwriting existing traces, not generating duplicate elements) you may also want to look at unique lazy rules, which can also take primitive type elements as input these days, e.g.:
unique lazy rule StringToEClass {
from s : String
to t : ECORE!EClass (
name <- s)
do {
thisModule.elementsMap <- thisModule.elementsMap->including(s, t);
t; -- return value
}
}
In EMFTVM, you don't even need to record your own traces for unique lazy rules. You can use the special, three-parameter version of resolveTemp() listed under https://wiki.eclipse.org/ATL/EMFTVM#ATL_Module_operations .
I propose to add your pattern as Custom Tracing, is that ok for you?
[Updated on: Wed, 04 March 2015 15:15] by Moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03574 seconds