I want to model the following scenario:
- A message a consists of one or more base types.
- Base types are uint8 .. uint64 and int8 .. int64.
- A message can also contain other messages.
Example:
Message position
- uint8 x
- uint8 y
Message movement
- position start
- position end
- uint8 speed
This is what i modeled in Sirius so far
The issue here is that I cannot link the message position twice to the message movement. Can you please provide a approach of modelling this problem?
Your modelization is lacking one "layer" to represent your "message type" / "message instance" structure.
I think what you need to do is something a bit like this:
MessageType
with a containment towardsBaseType
(which IMO should be renamed something likeMessageDataType
)MessageInstance
with a containment towards itself and a reference to aMessageType
.Then you end user must first create a
MessageType
instance, called "position" and a second one called "movement". Then create threeMessageInstance
instances, two pointing towardsMessageType
"movement" and one containing the first twoMessageInstance
instances.I would also advise seriously thinking about how you want to name your concepts, because there is a potential confusion between an Ecore instance of one of your EClass and the fact that you are effectively modeling a type/instance structure.