Book a Demo

Author Topic: how read multiplicity on an "association"(rhombus)  (Read 15765 times)

tonywacu

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
how read multiplicity on an "association"(rhombus)
« on: July 23, 2010, 06:45:44 pm »
Hello,

I have 4 tables that i would like to bring together for extract some data.
And i see that AE has a kind of 'rhombus' (losange) in a class diagramm.(association ->the last element in class diagramm element).

My problem is how to read multiplicity?  :-

thanks for your help

Tony,

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: how read multiplicity on an "association"(rhom
« Reply #1 on: July 23, 2010, 07:00:49 pm »
Hi Tony,

I think I know what you are asking, but I'd like some clarification before I respond more fully...

The Association Lozenge is an N-ary Association (of which the UML binary AssociationClass is a subset).  What exactly are you trying to do with the N-ary Association - simulate a data modelling tuple?  That IS one of it's uses.

If you could clarify (especially if you can post a diagram with the lozenge and the tables) we can discuss further.

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

tonywacu

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: how read multiplicity on an "association"(rhom
« Reply #2 on: July 23, 2010, 07:32:13 pm »
(how to insert a diagram here?? >:(     )

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: how read multiplicity on an "association"(rhom
« Reply #3 on: July 23, 2010, 08:34:40 pm »
Quote
(how to insert a diagram here?? >:(     )

You can't!

Pop one on any of the image sites and use the [img] link to point to it...

Sorry...
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

tonywacu

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: how read multiplicity on an "association"(rhom
« Reply #4 on: July 23, 2010, 11:03:58 pm »
Paolo,

it s Okay, but i ll do it to night on my computer because now i m working, and i "CONNOT"  copy the link....... :(

Thanks anyway,

See you

tonywacu

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: how read multiplicity on an
« Reply #5 on: August 04, 2010, 02:14:09 am »
Hello,

I m sorry, i wasn t here for a moment but here is the image:




but For me i have 4 tables "phase" "ficheEvaluation" "noteIndicateur" and "indicateurProjet".
To the "FicheEvaluation" i can have many "indicateurProjet"
and every "indicateurProjet" has a "noteIndicateur" which can change in time(like every two weeks).
NB: a "ficheEvaluation" concerne a "phase".
So for one "phase" i can have many "FicheEvaluation" too.

If it s not clear, i can tell you more.

thanks in advance!



« Last Edit: August 04, 2010, 02:25:23 am by 1987 »

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: how read multiplicity on an "association"(rhom
« Reply #6 on: August 04, 2010, 02:22:37 pm »
Hi Tony,

The following links show some discussion of the issue of the Association "Lozenge":

N-Ary Associations and Association Class
Navigability
Association Class Vs Associative Tables
New Edge type: AssociationEnd

The following diagram shows my resolution of the issue...  Note the special type of unary association  AssociationEnd...



Basically, the links you show with multiplicity can only be unary.... The multiplicity is held in the Association Lozenge.

If you have further questions, just ask...

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: how read multiplicity on an "association"(rhom
« Reply #7 on: August 04, 2010, 03:18:36 pm »
Tony,

In general my recommendation about n-ary association is: don't use them. Especially not if you have trouble understanding them (in which you are not alone, hence the recommendation ;))
Everything you model with an n-ary association can be modelled with binary associations as well.

About your issue, I think you need to be clear if you are talking about classes, or tables. In case of tables n-ary associations are not very usefull, since in a relational database you can only have binary associations (foreign keys).

About reading the multiplicity on the diagram image you posted, that is a many-to-many-to-many association.
Each Département can have many Employées and many Responsabilitées.
Each Responsabilité can have many Departements and many Employées.
And finally, each Employé can have many Responsabilitées and Departements.

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: how read multiplicity on an "association"(rhom
« Reply #8 on: August 04, 2010, 07:24:45 pm »
Quote
[size=18]...[/size]
Everything you model with an n-ary association can be modelled with binary associations as well.
[size=18]...[/size]
Sorry, Geert, I have to step in here...  The statement is wrong!  

The whole point of n-ary Associations is to model non-binary associations.  In this case, if Tony needs to know which employee has which responsibilities in which department, then he needs a ternary association.  If he doesn't need to know that then he doesn't need a ternary and your statement is fine.

It is certainly true that you can derive the binary relations you mention by traversing and aggregating the ternary, but that's an outcome, not the replacement.

It is unfortunate that non-functional languages aren't good at handling non-binary relationships, but that's life.  Certainly at the conceptual level, there's no difference between tables and classes.  From memory, one of the links I posted shows how to use code to manage a ternary.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: how read multiplicity on an "association"(rhom
« Reply #9 on: August 04, 2010, 07:35:51 pm »
Paolo,

I agree that, from a conceptual point ternary associations are much cleaner, but I'm sure you agree that you can model the same relations and constraints that are very elegantly modelled with a ternary association, can also be modelled with a combination of binary associations and constraints.

The reason I recommend agains ternary associations is purely pragmatic.
- The DB guys don't understand (since they only know binary foreign keys)
- Unfortunately most analysts have a hard time understanding ternary associations as well  :'(

So for now (untill common UML understanding improves) we only use binary associations.

Geert


Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: how read multiplicity on an "association"
« Reply #10 on: August 04, 2010, 09:07:40 pm »
Quote
[size=18]...[/size]
The reason I recommend agains ternary associations is purely pragmatic.
- The DB guys don't understand (since they only know binary foreign keys)
- Unfortunately most analysts have a hard time understanding ternary associations as well  :'(
[size=18]...[/size
DB guys should understand intersector tables - if they don't they are just masquerading as DB guys... :(
Most analysts aren't trained in anything much to do with data - so this is just another issue they can't model very well... :(

If you need a ternary (or other non-binary n-ary) then some combination of binaries WON'T do it... This understanding is fundamental to good world modelling and systems design.

To paraphrase Bill (Clinton - not Gates)...  It's the Data, stupid!

In Tony's case, he has to determine if he needs the ternary.  If not then he shouldn't use it (it's WRONG and - as you say- harder to get your head around).  If he does need it then he must use it (not an incorrect simulacrum).

Sorry to be so harsh on this but this is "101" stuff...

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

tonywacu

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: how read multiplicity on an "association"(rhom
« Reply #11 on: August 05, 2010, 08:04:24 pm »
hello guys,

thanks Poalo for the diagram, it helped me, as i ve tried all the tree methods (the two n aryclasses and the lozenge) and i was wondering if they are REALLY the same( a part from the fact that they  can all do what i want)... Actually they are the same.


Quote
The whole point of n-ary Associations is to model non-binary associations.  In this case, if Tony needs to know which employee has which responsibilities in which department, then he needs a ternary association.  If he doesn't need to know that then he doesn't need a ternary and your statement is fine.

Yeah thanks exactly what i wanted ;)
Finally I used the n aryassociation (with swapped multiplicities)

Quote
About your issue, I think you need to be clear if you are talking about classes, or tables. In case of tables n-ary associations are not very usefull, since in a relational database you can only have binary associations (foreign keys).

I am using the UML stuff (MOO- Model Orienté Objet) so i have classes instead of Tables, but i think it s the same... i mean it s not very important.

I agree with you, it s better to use a binary associations when it s possible,... for DB guys!!

[tr]In Tony's case, he has to determine[/tr]
funny!!! because, me i ll say:" In Tony's case, SHE has to determine......"  :)


Tony.