Database design using UML Class Diagram

浪子不回头ぞ 提交于 2019-12-06 02:17:43

问题


I would like to design a database using UML class diagrams but I dont know how. Can someone help me. How can I design a database using UML class diagrams?


回答1:


Making an SQL database model in the form of a UML class diagram from a general information design model essentially requires to

  1. Represent all entity types (or better: classes representing object types) as classes stereotyped as «object table» using SQL datatype names and replacing the UML {id} property modifier with a «pkey» stereotype:

  2. Eliminate enumeration attributes for DBMS that do not support enumerations by connecting the object table with a corresponding enum table via a foreign key dependency arrow (a UML dependency stereotyped «fkey»): Otherwise, as in the case of MySQL, you can use their syntax in the model like so:

  3. Eliminate multi-valued attributes:

  4. Eliminate associations:

    1. Replace any functional association with a foreign key dependency:
    2. Replace any many-to-many association (relationship type) with a class stereotyped as «association table» and two foreign key dependencies:
  5. Eliminate generalization/inheritance relationships:

See this book chapter for more information.




回答2:


you may try to start with a UML class diagram. Maybe you can find this tutorial useful - http://argouml-db.tigris.org/documentation/DB_UML_Guide.htm




回答3:


You can additionally use "Relation scheme diagram" to design table relationship and clearly represent primary key / foreign key dependencies.

see this tutorial.



来源:https://stackoverflow.com/questions/21358774/database-design-using-uml-class-diagram

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