使用UML类图进行数据库设计 [英] Database design using UML Class Diagram

查看:782
本文介绍了使用UML类图进行数据库设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用UML类图设计数据库,但我不知道如何。有人能帮我吗。如何使用UML类图设计数据库?

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?

推荐答案

以UML类图的形式创建SQL数据库模型一般信息设计模型本质上要求

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


  1. 将所有实体类型(或更优:表示对象类型的类)表示为构造型为«对象表»使用SQL数据类型名称并将UML {id} 属性修饰符替换为« pkey»原型:

  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:

为执行此操作的DBMS消除枚举属性通过外键依赖关系箭头(原型为UML依赖关系 fkey的UML依赖关系)将对象表与相应的枚举表连接,从而不支持枚举:

否则,就像在MySQL中一样,您可以在模型中使用它们的语法,如下所示:

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:

消除多值属性:

消除关联:


  1. 用外键依赖项替换任何功能关联:

  2. 替换任何具有千篇一律的类称为关联表的多对多关联(关系类型);和两个外键依赖项:


  • 消除泛化/继承关系:

  • Eliminate generalization/inheritance relationships:

    有关更多信息,请参见本书章节

    See this book chapter for more information.

    这篇关于使用UML类图进行数据库设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆