Extending the Graphiti Metamodel [message #1110166] |
Mon, 16 September 2013 13:25 |
Eclipse User |
|
|
|
Hi there,
I would like to know which of these two solutions may be the good one to
extend the Graphiti Metamodel concepts from the package "pictograms".
For example, I want to introduce a new concept "MyCustomContainerShape"
which is a particular "ContainerShape" with new attributes and references.
I think about two solutions :
I - Extending the Graphiti Metamodel
In this solution, I choose to develop an extension of the Graphiti
Metamodel whith the new concept: MyCustomContainerShape
-> ContainerShape -> Shape (-> for extending).
Then, once the ecore created, I generate the code of my custom factory
with the gen model referencing the graphiti genmodel.
Finally, in my addFeature code, I use both the peCreateService and my
own factory to create either Shape / Container Shape or MyCustomContainer.
II - Creating a new uncoupled Metamodel
In my second solution, I choose to design a new metamodel with my new
concept: MyCustomContainerShape.
Then, in my addFeature code, I create a ContainerShape, a
MyCustomContainerShape, and link the Container Shape to both the
MyCustomContainerShape and the BusinessObject. This gives the following
scheme:
Business Object --- Pictogram Container Shape --- MyCustomContainerShape
(--- is a link) where :
- Business Object is my Business Object serialized in my Business Model
Resource ;
- Pictogram Container Shape is the Graphiti Container Shape serialized
in my Diagrame Resource ;
- MyCustomContainerShape is my new concept serialized in my Diagram
Resource, enhancing the Container Shape with attributes et references.
Is one of these two solutions may be implementable ?
Thanks in advance,
Regards,
--
Nicolas H
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03183 seconds