Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » ASMModelWrapper => getModelFactory().getResourceSet() != getModelLoader().getResourceSet()
ASMModelWrapper => getModelFactory().getResourceSet() != getModelLoader().getResourceSet() [message #98719] Fri, 30 January 2009 03:02 Go to next message
Nicolas Rouquette is currently offline Nicolas RouquetteFriend
Messages: 157
Registered: July 2009
Senior Member
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()

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));

I also noticed that
org.eclipse.qvt.declarative.relations.atlvm.utils.ASMEMFMode lUtils is
using the old ATL APIs.

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. 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.
[ATL] Re: ASMModelWrapper => getModelFactory().getResourceSet() != getModelLoader().getResourceSe [message #98735 is a reply to message #98719] Fri, 30 January 2009 09:13 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 297
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 Go to previous message
Nicolas Rouquette is currently offline Nicolas RouquetteFriend
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
Previous Topic:Where is the Atlantic zoo?
Next Topic:[ATL] Basic mechanism
Goto Forum:
  


Current Time: Thu Aug 13 12:20:15 GMT 2020

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

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

Back to the top