Home » Archived » M2M (model-to-model transformation) » ASMModelWrapper => getModelFactory().getResourceSet() != getModelLoader().getResourceSet()
|
[ATL] Re: ASMModelWrapper => getModelFactory().getResourceSet() != getModelLoader().getResourceSe [message #98735 is a reply to message #98719] |
Fri, 30 January 2009 09:13 |
William Piers Messages: 302 Registered: July 2009 |
Senior Member |
|
|
Hello,
Nicolas Rouquette a écrit :
> Looking at the ATL 3.0 code, I noticed that there are two ways to get
> different ResourceSet objects:
>
> org.eclipse.m2m.atl.core.emf.EMFModelFactory.getResourceSet( )
> org.eclipse.m2m.atl.drivers.emf4atl.EMFModelLoader.getResour ceSet()
Those methods corresponds to two different strategies, you don't have to
use them simultaneously.
ATL launch configs, ant tasks, or any java-based app need to use the
core api to launch ATL. Then this api manages models depending of the
ATLVM you want to use: using EMFModelFactory (EMFVM) OR EMFModelLoader
(RegularVM).
So the ResourceSet use is delegated to a sub-layer, which clients are
not supposed to deal with.
Why this kind of architecture?
At least, we intent to switch definitely to only one ATLVM (EMFVM). But
as there are still missing features on the EMFVM (e.g. Debugger) and
some other projects strongly depending on RegularVM (TCS), we were
forced to do a transitional wrapper for RegularVM, using the
EMFModelLoader mechanism.
The ATL core api abstract layer allowed us to create a wrapper for the
RegularVM, which ever had a kind of API (which had a lot of conception
problems).
>
> Suppose we have:
>
> ASMModelWrapper modelWrapper = ...
>
> we can do:
>
> ResourceSet rSet1 = modelWrapper.getModelFactory().getResourceSet();
> ResourceSet rSet2 = modelWrapper.getModelLoader().getResourceSet();
>
> and we have:
>
> Assert.isTrue(!(rSet1.equals(rSet2));
>
As I explained before, you are not supposed to do that.
> I also noticed that
> org.eclipse.qvt.declarative.relations.atlvm.utils.ASMEMFMode lUtils is
> using the old ATL APIs.
>
At this time qvt declarative is still in a incubation phase, so it will
keep using ATL2.0 api, for the moment.
> Whoever fixes this will have to decide one way or the other how to get a
> ResourceSet. This might seem like a design detail to some but it is an
> important choice.
Consider that the old API is deprecated. But in fact, the intermediate
layer between clients and VMs allows to switch from a strategy to another.
> Consistent use of ResourceSet objects is one of the
> weakest aspects of the M2M architecture in my opinion. I don't know what
> to suggest. Hopefully some smart people have thought about this already...
>
> -- Nicolas.
We ever did a lot of work about that, especially with Dennis Wagelaar's
help. He did some successfull tries on ATL model handlers API (old one),
then we applied those principles on the new one.
In a few words, ATL creates an unique resourceSet for each
transformation, which is "garbage collected" after execution. As EMF
automatically load resources, it avoids a memory overflow which was
occuring after a lot of launches.
I will try to give more explanations, schemas, on the wiki about all of
that ASAP :-).
Best regards,
William
|
|
|
Re: [ATL] Re: ASMModelWrapper => getModelFactory().getResourceSet() != getModelLoader().getResour [message #98781 is a reply to message #98735] |
Fri, 30 January 2009 16:49 |
Nicolas Rouquette Messages: 157 Registered: July 2009 |
Senior Member |
|
|
William Piers wrote:
> Hello,
>
> Nicolas Rouquette a écrit :
>> Looking at the ATL 3.0 code, I noticed that there are two ways to get
>> different ResourceSet objects:
>>
>> org.eclipse.m2m.atl.core.emf.EMFModelFactory.getResourceSet( )
>> org.eclipse.m2m.atl.drivers.emf4atl.EMFModelLoader.getResour ceSet()
>
> Those methods corresponds to two different strategies, you don't have to
> use them simultaneously.
> ATL launch configs, ant tasks, or any java-based app need to use the
> core api to launch ATL. Then this api manages models depending of the
> ATLVM you want to use: using EMFModelFactory (EMFVM) OR EMFModelLoader
> (RegularVM).
> So the ResourceSet use is delegated to a sub-layer, which clients are
> not supposed to deal with.
If we chain launch configurations, then what you are saying suggests
that we need to use the same ATLVM for all launch configurations in that
chain.
> Why this kind of architecture?
>
> At least, we intent to switch definitely to only one ATLVM (EMFVM). But
> as there are still missing features on the EMFVM (e.g. Debugger) and
> some other projects strongly depending on RegularVM (TCS), we were
> forced to do a transitional wrapper for RegularVM, using the
> EMFModelLoader mechanism.
Ah, thanks for the clarification.
>> Consistent use of ResourceSet objects is one of the weakest aspects of
>> the M2M architecture in my opinion. I don't know what to suggest.
>> Hopefully some smart people have thought about this already...
>>
>> -- Nicolas.
>
> We ever did a lot of work about that, especially with Dennis Wagelaar's
> help. He did some successfull tries on ATL model handlers API (old one),
> then we applied those principles on the new one.
> In a few words, ATL creates an unique resourceSet for each
> transformation, which is "garbage collected" after execution. As EMF
> automatically load resources, it avoids a memory overflow which was
> occuring after a lot of launches.
>
> I will try to give more explanations, schemas, on the wiki about all of
> that ASAP :-).
Thanks.
-- Nicolas.
>
> Best regards,
>
> William
|
|
|
Goto Forum:
Current Time: Thu Dec 26 19:10:39 GMT 2024
Powered by FUDForum. Page generated in 0.03204 seconds
|