- 领域建模
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/24 19:25:11 */
/*==============================================================*/
drop table if exists t_card;
drop table if exists t_cardhoder;
drop table if exists t_city;
drop table if exists t_customer;
drop table if exists t_hotel;
drop table if exists t_order;
/*==============================================================*/
/* Table: t_card */
/*==============================================================*/
create table t_card
(
email longtext not null,
card_number char(10),
card_security_code char(10),
expiry_date char(10),
primary key (email)
);
/*==============================================================*/
/* Table: t_cardhoder */
/*==============================================================*/
create table t_cardhoder
(
title longtext,
first_name longtext,
last_name longtext,
address1 longtext,
address2 longtext,
city longtext,
state longtext,
country longtext,
postcode longtext,
evening_telephone longtext,
email longtext not null,
primary key (email)
);
/*==============================================================*/
/* Table: t_city */
/*==============================================================*/
create table t_city
(
city longtext,
hotel longtext not null,
primary key (hotel)
);
/*==============================================================*/
/* Table: t_customer */
/*==============================================================*/
create table t_customer
(
full_name longtext,
email longtext not null,
special_requirement text,
smoking bool,
primary key (email)
);
/*==============================================================*/
/* Table: t_hotel */
/*==============================================================*/
create table t_hotel
(
hotel longtext,
room longtext not null,
primary key (room)
);
/*==============================================================*/
/* Table: t_order */
/*==============================================================*/
create table t_order
(
room longtext not null,
t_c_email longtext,
time date,
email bool,
primary key (room)
);
alter table t_card add constraint FK_Reference_1 foreign key (email)
references t_customer (email) on delete restrict on update restrict;
alter table t_cardhoder add constraint FK_Reference_6 foreign key (email)
references t_card (email) on delete restrict on update restrict;
alter table t_hotel add constraint FK_Reference_2 foreign key (hotel)
references t_city (hotel) on delete restrict on update restrict;
alter table t_order add constraint FK_Reference_3 foreign key (room)
references t_hotel (room) on delete restrict on update restrict;
alter table t_order add constraint FK_Reference_4 foreign key (t_c_email)
references t_customer (email) on delete restrict on update restrict;
数据库逻辑模型 与 领域模型 区别:
数据模型是系统设计,以及实现的一部分,描述的是对用户需求在技术上的实现方法。用户不需要关心系统的数据模型,但是必须关注领域模型,因为领域模型反映的是问题域的相关业务概念以及其关系,领域模型是用户业务描述的高度抽象,来源于业务需求的描述,同时又可以帮助用户和需求分析人员更好的理解业务需求。