Conceptual Modelling - Is my drawing correct ?

删除回忆录丶 提交于 2019-12-25 12:25:41

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!