database 如何决定是使用ER还是UML进行建模?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 
原文地址: http://stackoverflow.com/questions/13273055/
Warning: these are provided under cc-by-sa 4.0 license.  You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to decide whether to use ER or UML for modelling?
提问by stallion
A UML diagram can be used both to model database designs and class designs, but an ER diagram should be used exclusively in database problems. How do you pick one graphical representation over the other?
UML 图可用于对数据库设计和类设计进行建模,但 ER 图应专门用于数据库问题。您如何选择一种图形表示而不是另一种图形表示?
回答by ilansch
ERD - Entity Relation Diagram - giving you image of how the tables should connect, what fields are going to be on each table, the tables connection, if many-to-many, one-to-many.
ERD - 实体关系图 - 为您提供表应该如何连接的图像,每个表上将有哪些字段,表连接,如果是多对多,一对多。
UML can be used for many diagrams other then ERD. sequence diagram, state diagram, more for the funcionality of the application (what user can do, who does it, when he does it, before what step, what table he use to do it) other then the tables description.
UML 可用于 ERD 以外的许多图表。顺序图,状态图,更多的是关于应用程序的功能(用户可以做什么,谁做,他什么时候做,在什么步骤之前,他用什么表来做),而不是表描述。
I Would use ERD to describe database relation and UML to describe operations, time, actions, etc..
我会用 ERD 来描述数据库关系,用 UML 来描述操作、时间、动作等。
Refer wiki :Entity-relationship_diagram& Unified_Modeling_Language
回答by Jordi Cabot
Just use always UML since it kind of subsumes ER. The only reason to use ER would be if you′re using a tool (e.g. to generate the DDL SQL scripts to create the tables) that only supports ER (now most do support UML but you may still find some that sticked to ER)
只需始终使用 UML,因为它包含了 ER。使用 ER 的唯一原因是如果您使用的工具(例如生成 DDL SQL 脚本来创建表)只支持 ER(现在大多数都支持 UML,但您可能仍然会发现一些坚持使用 ER)
回答by gregwhitaker
UML is the notation so if you are speaking with people who understand UML it would be beneficial to use UML. A classical entity relationship diagram is usually in Chen notation.
UML 是符号,因此如果您与了解 UML 的人交谈,使用 UML 将是有益的。经典的实体关系图通常采用陈记法。
Personally I have found that I always use UML for modeling entity relationships and only used Chen in academia.
我个人发现我总是使用 UML 来建模实体关系,而在学术界只使用 Chen。

