Book a Demo

Author Topic: HOw ot show cardinality for this relationship?  (Read 3379 times)

hello

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
HOw ot show cardinality for this relationship?
« on: November 28, 2008, 01:13:02 pm »
Hi there,

This following link shows an image of two classes Reciepie and Ingredient.

http://umlontherun.spaces.live.com/blog/cns!981DDCEE87640AE3!128.entry

pleases send your repllies tothe follwing email (if you've modifies the classes) [email protected]

Buiness rule say that :
1. "Reciepie" can have maximum of 12 "Ingredient" objects
2. In each "Ingredient" object in the "Reciepie" there can be maximum of 5 of the same Ingredient (Consider Ingredient such as Onions Potatoes, Carrots, ....if i cosnider an Ingredient: Onions, there can be maximum of 5 Onions in a recipie....)

Ingredient(max 12 Items)      per Ingredient(MAX 5)
Onions                                        3
Potatoes                                      2
Carrots                                        3
........
Beetroot(12th Ingredient)              5


Q:
1. What kind of relationship is this? (the composition that i have put is correct?)

2. How do i put those business rules into a class diagram (we can use only Ingredient class and the Reciepie class)

cheers
« Last Edit: November 28, 2008, 02:28:22 pm by RoyC »

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: How to show cardinality for this relationship?
« Reply #1 on: December 03, 2008, 11:33:49 am »
The maximum and actual amounts of each ingredient are "facts" about the relationship itself.  You need to add an AssociationClass to the composition to hold these facts - which will appear as attributes therein.

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

RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: HOw ot show cardinality for this relationship?
« Reply #2 on: December 03, 2008, 12:06:43 pm »
So, can you do that in Visio?
Best Regards, Roy