1、 领域建模
- a. 阅读 Asg_RH 文档,按用例构建领域模型。
- 按 Task2 要求,请使用工具 UMLet,截图格式务必是 png 并控制尺寸
- 说明:请不要受 PCMEF 层次结构影响。你需要识别实体(E)和 中介实体(M,也称状态实体)
- 在单页面应用(如 vue)中,E 一般与数据库构建有关, M 一般与 store 模式 有关
- 在 java web 应用中,E 一般与数据库构建有关, M 一般与 session 有关
- b. 数据库建模(E-R 模型)
- 按 Task 3 要求,给出系统的 E-R 模型(数据逻辑模型)
- 建模工具 PowerDesigner(简称PD) 或开源工具 OpenSystemArchitect
- 不负责的链接 http://www.cnblogs.com/mcgrady/archive/2013/05/25/3098588.html
- 导出 Mysql 物理数据库的脚本
- 简单叙说 数据库逻辑模型 与 领域模型 的异同 /*==============================================================*/ /* DBMS name: MySQL 5.0 */ /* Created on: 2018/4/29/周日 19:40:53 */ /*==============================================================*/ drop table if exists Creditcard; drop table if exists Customer; drop table if exists Hotel; drop table if exists Room; /*==============================================================*/ /* Table: Creditcard */ /*==============================================================*/ create table Creditcard ( account varchar(20) not null, email varchar(20), password varchar(20), primary key (account) ); /*==============================================================*/ /* Table: Customer */ /*==============================================================*/ create table Customer ( name varchar(20), email varchar(20) not null, primary key (email) ); /*==============================================================*/ /* Table: Hotel */ /*==============================================================*/ create table Hotel ( name varchar(20) not null, email varchar(20), location text, primary key (name) ); /*==============================================================*/ /* Table: Room */ /*==============================================================*/ create table Room ( roomID int not null, email varchar(20), name varchar(20), roomType text, primary key (roomID) ); alter table Creditcard add constraint FK_hasCreditcard foreign key (email) references Customer (email) on delete restrict on update restrict; alter table Hotel add constraint FK_orderHotel foreign key (email) references Customer (email) on delete restrict on update restrict; alter table Room add constraint FK_hasRoom foreign key (name) references Hotel (name) on delete restrict on update restrict; alter table Room add constraint FK_orderRoom foreign key (email) references Customer (email) on delete restrict on update restrict;
领域模型和数据库逻辑模型都抽象出主要的类,描述不同类之间的关系。但领域模型只是一个概念图,有的类并不会真正成为数据库的实体。逻辑模型是将领域模型转化为具体的数据模型的过程,即按照概念结构设计阶段建立的基本E-R图,按选定的管理系统软件支持的数据模型(层次、网状、关系、面向对象),转换成相应的逻辑模型。这种转换要符合关系数据模型的原则。因此,逻辑模型比领域更接近数据库的实现。