How to create a link to existing model objects?

I am new to MDSD / EMF, but have made great strides thanks to the support of Eclipse.

I created a toy model, as I answered yesterday, as Auyn suggested, and I am very close. I use only EMF and the created tree editor.

Here is a summary of my EMF metamodel:

- EClass: Widget
  - name

- EClass: WidgetReference
  - aWidgetReference : Widget [0..1] Containment = false

- EClass: WidgetContainer
  - myWidgets : Widget [0..*] Containment = true

- EClass: ReferenceContainer
  - myReferences : WidgetReference [0..*] Containment = true

- EClass: TopLevelClass
  - myWidgetContainer    : [1] WidgetContainer    Containment = true
  - myReferenceContainer : [1] ReferenceContainer Containment = true

What is happening now is that in the generated editor tree for the model, I create everything starting with TopLevelClass. I can successfully create multiple widgets in the WidgetContainer, and I can create a single WidgetReference in the ReferenceContainer and associate it with specific widgets.

In case someone encounters this, there is an error in the generated code of the EMF editor:

WidgetReference ReferenceContainer, WidgetReference ReferenceContainer. WidgetReferences , WidgetReferences. , , , .

- , , , . .

/.

+3
2

, "". , ( = EMF), . , , . ( = ), . , = false.

Acceleo, EMF ( GMF): -, , , "new → child → ChildObject". , , , .

? , EMF.

+3

, EMF - , . . Generic EMF , " ...". , ( ).

. Ecore . .

, , , .

0

Source: https://habr.com/ru/post/1774192/


All Articles