UML Domain Modeling

后端 未结 4 2193
醉梦人生
醉梦人生 2021-02-08 14:20

What is the difference between a domain model and a data model?

4条回答
  •  粉色の甜心
    2021-02-08 15:08

    A data model is focused on the DB schema definition, including tables, columns, and relationships.

    A domain model is focused on the business domain, including concepts (classes of objects), behavior (methods/logic), and relationships.

    In both cases, the cardinality is used for relationships (e.g. 1:1, 1:Many, 0:Many, ...).

    That said, you would ideally like the data model and domain model to be closely related, i.e. a Person with name, ... and a MailingAddress, ... relates to a PERSON table with a NAME column and a FK to a MAILING_ADDR table entry. You have to decide where logic is hosted - in the objects in the software system vs. in the DB via procedures, triggers, and such.

提交回复
热议问题