UML class diagram for database

前端 未结 3 2023
庸人自扰
庸人自扰 2021-01-16 13:55

I have an assignment for developing a hotel reservation system! One of tasks is to develop UML class diagram! However, in the task description it is written \"Class diagra

3条回答
  •  耶瑟儿~
    2021-01-16 14:11

    The language of UML class diagrams can be used for many different purposes. For instance, for making

    1. conceptual information models
    2. platform-independent information design models
    3. platform-specific data models for all kinds of executable languages dealing with data structures (including SQL and OO programming languages)

    Each of these different types of models uses only certain UML class modeling elements, and not others. For instance, in SQL data models we don't use

    • visbility
    • interfaces
    • attributes whose type/range is another class
    • many-to-many (non-functional) associations
    • generalization

    In fact, since SQL does not really have any explicit association concept, but only the concept of foreign key dependencies, which can be used for representing functional associations, we better shouldn't use any association in an SQL data model, but rather dependency arrows corresponding to foreign key dependencies.

    It also makes sense to define two stereotypes for use in SQL data models:

    1. «pkey» as an attribute stereotype for primary key attributes
    2. «fkey» as a dependency stereotype for foreign key dependencies

    See this tutorial for more information.

提交回复
热议问题