Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Help to create the well-known UML Relationships
Help to create the well-known UML Relationships [message #228140] Wed, 29 April 2009 08:47 Go to next message
Juan is currently offline JuanFriend
Messages: 29
Registered: July 2009
Junior Member
Hi everyone,

I need to do something very similar to UML Relationships among classes.
But not in the way that EcoreTools example do, because it doesn't match
the visual figures with any model, it simply draws different connections
between classes.

My model structure is:

Domain
|--classes: ClassType
|--relations: Relationtype

ClassType
|--Property: PropertyType

PropertyType
|--lowerBound
|--upperBound
|--name

RelationType
|--first: PropertyType
|--second: PropertyType



As you can see, Relationships match TWO properties (of classes), not TWO
classes. Example: a relationship between Person and House classes is
modelled as a property for person called "owns" (with a particular lower
and upper bounds) and another for House called "ownedBy" (with other
lower and upper bounds). Then I would create a relationship with that 2
properties. But in the diagram I only want to see a connection among the
two classes!!

I have tried to model it in different ways with GMFMAP but I see it
impossible without doing code for a XXXEditPart. Isnt' it true? (I'm
begginner). I have thought that I manually will have to create a
property for each class, and a relation object with the two properties
recently created when a connection is created. Problem: I don't know
where and how to write this code. And how to synchronize it when a user
edits the relation.

All kind of help will be great for me!! Thnx a lot.
Re: Help to create the well-known UML Relationships [message #228221 is a reply to message #228140] Wed, 29 April 2009 10:06 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Juan Miguel Ávila Nieto,

An option is to create transient derived reference pointing from RelationType
to ClassType and implement the logic of PropertyType creation/setting RelationType.first/second
references there.

-----------------
Alex Shatalin
Re: Help to create the well-known UML Relationships [message #228236 is a reply to message #228221] Wed, 29 April 2009 10:45 Go to previous messageGo to next message
Juan is currently offline JuanFriend
Messages: 29
Registered: July 2009
Junior Member
Thanks Alex Shatalin,
I explained something bad before:
RelationType.first/second are actually Ereferences pointing to
PropertyType. But they aren't transient and derived. Why do it so?
Finally, where are the main files where I probably will have to
implement the logic?

Thanks again and forgive my probably silly questions. I have used GMF
very little yet.


Alex Shatalin escribió:
> Hello Juan Miguel Ávila Nieto,
>
> An option is to create transient derived reference pointing from
> RelationType to ClassType and implement the logic of PropertyType
> creation/setting RelationType.first/second references there.
>
> -----------------
> Alex Shatalin
>
>
Re: Help to create the well-known UML Relationships [message #228381 is a reply to message #228236] Wed, 29 April 2009 14:38 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Juan Miguel Ávila Nieto,

> RelationType.first/second are actually Ereferences pointing to
> PropertyType. But they aren't transient and derived. Why do it so?
I suggested you to create another transient derived reference pointing from
RelationType to ClassType like: RelationType.firstClassType/secondClassType.
There references will be derived from RelationType.first/second and return
corresponding ClassType (one containing PropertyType).

> Finally, where are the main files where I probably will have to
> implement the logic?
In case of derived properties - you have to implement RelationType.getFirstClassType()/.setFirstClassType()/.getSe condClassType()/.setSecondClassType()

-----------------
Alex Shatalin
Previous Topic:Method layout(View, String) in LayoutService might fail
Next Topic:Display nodes associated to an element mapped to a Link
Goto Forum:
  


Current Time: Thu Apr 25 19:19:56 GMT 2024

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

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

Back to the top