|
(no subject) [message #722079 is a reply to message #721644] |
Sun, 04 September 2011 05:37  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03406 seconds