对 UML 类图的反馈
我正在为剧院的简单预订系统创建一个类图。我想知道该图是否有意义以及是否需要更改任何内容(箭头方向)才能使其正确?
谢谢。 图片网址:https://i.sstatic.net/zWiGW.jpg
I am creating a Class Diagram for a simple booking system for the theater. I would like to know if the diagram makes any sense and if anything needs to be changed (arrow directions) in order for it to be correct?
Thanks.
Image URL: https://i.sstatic.net/zWiGW.jpg
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
以下是一些您认为合适的建议,您可以随意采纳或忽略:
我认为您的模型需要做很多工作。
Here are some recommendations that you're free to incorporate or ignore as you see fit:
I think your model needs a lot of work.
除了达菲莫所说的之外,这里还有一些与该特定图表并不严格相关的一般观察结果,而是与您的建模实践相关。
如果关联是单向导航的,则无需命名两端。您已命名了所有关联的两端,但只有可导航端需要名称。
从所有关联末端删除“can”。在某些情况下,有一个方便的术语,例如节目可以在场地举办。但在其他情况下,将关联端命名为与该端的类相同的名称是完全可以的,甚至是常见的做法。 (因此将席位端简单命名为 Seats)
如果可以的话,避免多对多关系。如果您不能考虑在两者之间添加关联类,它几乎总是有意义的。
In addition to what duffymo said, here are some generic observations not strictly related to this particular diagram but rather you modeling practices.
If an association is one way navigable then there is no need to name both ends. You have named both ends of all associations, but only navigable end needs a name.
Drop the 'can' from all association ends. In some cases there is a handy term, for example show can be hosted at a Venue. But in other cases it's perfectly fine and even common practice to name association ends same as the class at that end. (so name the Seat end simply Seats)
Avoid many to many relationships if you can. If you can't then look into adding an association class in between, it almost always makes sense.