问题
I have a exam tomorrow and we have gotten a sample exam, but since there are no answers to this sample exam, Id thought Id ask here.
So here we go, this is one of the questions Im not sure if ive done correctly: Q: Draw a conceptual model describing the following domain. In the domain there are monkeys and bananas. A Monkey can eat bananas BUT two monkeys can not eat the same banana.
A(which I think is correct): http://gyazo.com/722ee8618bfee76ed9f616d45d800819
Now, the reason why I think my answer is incorrect is because two monkey is able to eat the same bananas (or is it correctly done?)
Appreaciate any kind of help, thanks...
回答1:
Your model is missing association ends, which are very important. They confer semantics and multiplicities in both directions. An implementation model would be:
|Monkey|--eatingMonkey[0..1]---------eatenBanana[0..*]--|Banana|
That prevents the banana from being eaten by more than one Monkey. This is pidgin UML, so I hope you understand how to make a UML diagram like that.
Since this should be a conceptual model, you can rename eatingMonkey
to is eaten by
and eatenBanana
to eats
, as follows:
|Monkey|--is eaten by[0..1]---------eats[0..*]--|Banana|
That model forms the natural language sentences:
- A Monkey eats any number of Bananas.
- A Banana is eaten by up to one Monkey.
来源:https://stackoverflow.com/questions/30686510/conceptual-modelling-is-my-drawing-correct