Magritte - representing multiple relationships between two classes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Magritte - representing multiple relationships between two classes

Ben Coman
I am just about to dip my toe into trying out Magritte to implement a
UML model and would like to clarify how bidirection relationships work.

Section 2.6.1 of [1] says... "A relationship is always defined from the
described object to the referenced object.
To describe a two-way relationship the developer has to define a
relationship description at both ends of the association."
I haven't seen a specific Magritte example of that, but I assume it is
similar to the Phosyden example [2]

 > personEntity hasOne: #Pet as: #myPet.
 > petEntity hasOne: #Person as: #owner.


That makes sense where there is only a single relation between two
classes. However where there are two relations between two classes as
shown in attached image, how are relations (1a,1b) paired together and
(2a,2b) pair together. Or would this pairing generally be of no
consequence?

I would naively assume these four definitions...
1a. topologicalNodeEntity hasOne: #TopologicalIsland as: #topologicalIsland.
1b. topologicalIslandEntity hasMany: #TopologicalNode as: #topologicalNodes.
2a. topologicalNodeEntity hasOne: #TopologicalIsland as:
#angleRefTopologicalIsland.
2b. topologicalIslandEntity hasOne: #TopologicalNode as:
#angleRefTopologicalNode.

cheers, Ben

[1] http://www.iam.unibe.ch/~scg/Archive/Diploma/Reng06a.pdf
[2]
http://dbxtalk.smallworks.com.ar/pier/Documentation/mission-4_-about-relations


_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki

Magritte multiple relationships between two classes (2).png (16K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Magritte - representing multiple relationships between two classes

Lukas Renggli
Hi Ben,

Magritte does not model UML. For that you probably better look at FAME
(http://scg.unibe.ch/wiki/projects/fame/fm3) that provides an
EMOF-like model.

Magritte does not support bidirectional relationships, although one
could probably add support for that.

Cheers,
Lukas


On 17 January 2012 16:57, Ben Coman <[hidden email]> wrote:

> I am just about to dip my toe into trying out Magritte to implement a UML
> model and would like to clarify how bidirection relationships work.
>
> Section 2.6.1 of [1] says... "A relationship is always defined from the
> described object to the referenced object.
> To describe a two-way relationship the developer has to define a relationship
> description at both ends of the association."
> I haven't seen a specific Magritte example of that, but I assume it is
> similar to the Phosyden example [2]
>
>> personEntity hasOne: #Pet as: #myPet.
>> petEntity hasOne: #Person as: #owner.
>
>
> That makes sense where there is only a single relation between two classes.
> However where there are two relations between two classes as shown in
> attached image, how are relations (1a,1b) paired together and (2a,2b) pair
> together. Or would this pairing generally be of no consequence?
>
> I would naively assume these four definitions...
> 1a. topologicalNodeEntity hasOne: #TopologicalIsland as: #topologicalIsland.
> 1b. topologicalIslandEntity hasMany: #TopologicalNode as: #topologicalNodes.
> 2a. topologicalNodeEntity hasOne: #TopologicalIsland as:
> #angleRefTopologicalIsland.
> 2b. topologicalIslandEntity hasOne: #TopologicalNode as:
> #angleRefTopologicalNode.
>
> cheers, Ben
>
> [1] http://www.iam.unibe.ch/~scg/Archive/Diploma/Reng06a.pdf
> [2]
> http://dbxtalk.smallworks.com.ar/pier/Documentation/mission-4_-about-relations
>
>
> _______________________________________________
> Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki



--
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki