用户和评论的 UML 实体关系图
我对实体关系图很陌生,但我正在尝试为应用程序规划一个概念。
以 Facebook 为例,用户可以在彼此的墙上、自己的墙上以及活动和粉丝页面的墙上发表评论。
我的问题是:如果用户的评论可以针对自己和其他用户,那么如何编写用户与其评论之间关系的 UML 图?
I am new to entity-relationship diagrams, but I am trying to plan out a concept for an app.
Using Facebook as an example, users can write comments on each other's walls, on their own walls, and on the walls for events and fan pages.
My question is this: How do you write a UML diagram for the relationship between a user and their comments, if their comments can be made to themselves and to other users?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
UML 是一种对象方法,而实体关系图与数据自上而下的方法相关。
我所做的就是混合类图,生成来自我的数据库配置文件的 java 注释,然后添加 Hibernate 映射器来创建我的数据库。
真的很酷,但这仍然不是实体关系图。
(来源:forum-omondo.com)
UML is an object approach while entity-relational diagrams are related to data top down approach.
What I do is to mix Class diagram generating java annotations coming from my Database profile and then add Hibernate mapper to create my database.
Really cool but this is still not entity-relationship diagrams.
(source: forum-omondo.com)
诚然,UML 是面向 OO 的,但这并不意味着它不能用于数据建模。您可以简单地使用类图,它甚至允许您指定外键。然而,工具支持值得怀疑。
It is true that UML is aimed towards OO, but it doesn't mean it cannot be used for data modeling. You can simply use the class diagram, which allows you to specify even foreign keys. However the tool support is questionable.