Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTo] How models from QVT conforms to models from EMF ?
[QVTo] How models from QVT conforms to models from EMF ? [message #721644] Fri, 02 September 2011 12:17 Go to next message
Piotr  aj?czkowski is currently offline Piotr aj?czkowskiFriend
Messages: 8
Registered: June 2011
Junior Member

Hi everybody Smile

I would like to know how the "mapping" from EMF models to "QVT models" is done. I mean - I would like to know exactly how to make an EMF model for using it in QVT like something like this:

metamodel ABC {
  class A {
    b_elems : Sequence(B);
    contains c_elemnt : Sequence(C);
  }
  class B {
    str: String;
    int: Integer;
    bool : Boolean;
  }
  class C extends B {
    a_set : Set(A);
  }
}

(this is QVT-like metamodel description)

1. How to implement "sequence" in EMF ?
2. How to implement "set" in EMF ?
(exactly: could you show me an example of EMF metamodel that conforms to my example ?)

Edit:
I will have to use dynamic models and metamodels if it makes a difference (I mean: created from scratch in my Java code).

Thanks in advance Smile

Greetings,

Piotr Zajączkowski

[Updated on: Fri, 02 September 2011 12:18]

Report message to a moderator

(no subject) [message #722079 is a reply to message #721644] Sun, 04 September 2011 09:37 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7675
Registered: July 2009
Senior Member
Hi Piotr

Understanding this is currently aggravated by an OCL/UML inconsistency,
that may be resolved in the next version.

UML: T[*]{ordered, unique} == OCL: OrderedSet(T)

UML cannot declare nested collections, OCL can; Sequence(Set(String)).
OCL cannot declare bounded collections, UML can; String[2..4] {ordered}.

Ecore and UML are similar (except that Ecore has EString rather than
String etc and in practice all collections are realised by EList<T>).

You can see the EMF types by creating a simple Ecore model, so for
Sequence, create

class X
{
property names : String[*] { ordered, !unique }
}

and then genmodeling to produce Java code.

You may find the OCLinEcore editor convenient for textual model definition.

Regards

Ed Willink


On 02/09/2011 13:17, Piotr aj?czkowski wrote:
> Hi everybody :)
>
> I would like to know how the "mapping" from EMF models to "QVT models"
> is done. I mean - I would like to know exactly how to make an EMF
> model for using it in QVT like something like this:
>
>
> metamodel ABC {
> class A {
> b_elems : Sequence(B);
> contains c_elemnt : Sequence(C);
> }
> class B {
> str: String;
> int: Integer;
> bool : Boolean;
> }
> class C extends B {
> a_set : Set(A);
> }
> }
>
> (this is QVT-like metamodel description)
>
> 1. How to implement "sequence" in EMF ?
> 2. How to implement "set" in EMF ?
> (exactly: could you show me an example of EMF metamodel that conforms
> to my example ?)
>
> Thanks in advance :)
>
> Greetings,
> Piotr Zajączkowski
Previous Topic:[ATL] Check for duplicate target objects.
Next Topic:About ATL transformations and classes in the target model
Goto Forum:
  


Current Time: Sat Oct 05 06:26:36 GMT 2024

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

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

Back to the top