Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » Transform models independently of their corresponding metamodels
Transform models independently of their corresponding metamodels [message #75490] Wed, 27 February 2008 16:13 Go to next message
Eclipse UserFriend
Originally posted by: rivera.lcc.uma.es

Dear all,

I'm trying to transform Ecore models to another platform. Actually, I
would like to transform models whatever the metamodels it conforms to.
Taking Ecore as the metamodel, and using EObject and its operations (and
reflection) I can transform whatever model to my platform, since I
transform EObject to my platform's corresponding objects.

The problem is the reverse transformation, since I can transform from my
platform's corresponding objects to EObjects, but I can not (I don't
know how) set the EClass to the EObject. EObject has an operation named
"eClass" to obtain its metaclass and an operation "eSet" to set the
value of an attribute, but there is not an operation named "eSetEClass"
to set the corresponding eClass (something like changing its metaclass
from EObject to a specific one). Does anybody know how to handle it?

Thanks in advance,
Jose E. Rivera
Re: Transform models independently of their corresponding metamodels [message #75508 is a reply to message #75490] Wed, 27 February 2008 16:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Jose,

I'm not sure if this is an ATL question or a more general one. In the
latter case, you should create the right type of object up front.
InternalEObject has an eSetClass method, but if you are transforming to
a generated model, you need to create the right implementation class.
So you should use EcoreUtil.create(EClass) to create the right type of
instance up front...


Jose E. Rivera wrote:
> Dear all,
>
> I'm trying to transform Ecore models to another platform. Actually, I
> would like to transform models whatever the metamodels it conforms to.
> Taking Ecore as the metamodel, and using EObject and its operations
> (and reflection) I can transform whatever model to my platform, since
> I transform EObject to my platform's corresponding objects.
>
> The problem is the reverse transformation, since I can transform from
> my platform's corresponding objects to EObjects, but I can not (I
> don't know how) set the EClass to the EObject. EObject has an
> operation named "eClass" to obtain its metaclass and an operation
> "eSet" to set the value of an attribute, but there is not an operation
> named "eSetEClass" to set the corresponding eClass (something like
> changing its metaclass from EObject to a specific one). Does anybody
> know how to handle it?
>
> Thanks in advance,
> Jose E. Rivera
Re: Transform models independently of their corresponding metamodels [message #75611 is a reply to message #75508] Mon, 03 March 2008 09:07 Go to previous message
Eclipse UserFriend
Originally posted by: rivera.lcc.uma.es

Sorry,

I forgot to explicitly mention that I want to do it with ATL... Is there
something similar to EcoreUtil for ATL?

Thanks in advance

Ed Merks escribió:
> Jose,
>
> I'm not sure if this is an ATL question or a more general one. In the
> latter case, you should create the right type of object up front.
> InternalEObject has an eSetClass method, but if you are transforming to
> a generated model, you need to create the right implementation class.
> So you should use EcoreUtil.create(EClass) to create the right type of
> instance up front...
>
>
> Jose E. Rivera wrote:
>> Dear all,
>>
>> I'm trying to transform Ecore models to another platform. Actually, I
>> would like to transform models whatever the metamodels it conforms to.
>> Taking Ecore as the metamodel, and using EObject and its operations
>> (and reflection) I can transform whatever model to my platform, since
>> I transform EObject to my platform's corresponding objects.
>>
>> The problem is the reverse transformation, since I can transform from
>> my platform's corresponding objects to EObjects, but I can not (I
>> don't know how) set the EClass to the EObject. EObject has an
>> operation named "eClass" to obtain its metaclass and an operation
>> "eSet" to set the value of an attribute, but there is not an operation
>> named "eSetEClass" to set the corresponding eClass (something like
>> changing its metaclass from EObject to a specific one). Does anybody
>> know how to handle it?
>>
>> Thanks in advance,
>> Jose E. Rivera
Previous Topic:[ATL] Model Handler MDR
Next Topic:Applying ATL Transformation
Goto Forum:
  


Current Time: Thu Apr 25 06:07:14 GMT 2024

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

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

Back to the top