本文主要是介绍系统分析与设计lesson7,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
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: Sybase SQL Anywhere 12 */
/* Created on: 2018/4/28 21:23:29 */
/*==============================================================*/if exists(select 1 from sys.sysforeignkey where role='FK_HOTEL_REFERENCE_ROOM') thenalter table hoteldelete foreign key FK_HOTEL_REFERENCE_ROOM
end if;if exists(select 1 from sys.sysforeignkey where role='FK_RESERVAT_REFERENCE_HOTEL') thenalter table reservationdelete foreign key FK_RESERVAT_REFERENCE_HOTEL
end if;if exists(select 1 from sys.sysforeignkey where role='FK_RESERVAT_REFERENCE_PAYMENT') thenalter table reservationdelete foreign key FK_RESERVAT_REFERENCE_PAYMENT
end if;if exists(select 1 from sys.sysforeignkey where role='FK_RESERVAT_REFERENCE_TRAVELLE') thenalter table reservationdelete foreign key FK_RESERVAT_REFERENCE_TRAVELLE
end if;if exists(select 1 from sys.sysforeignkey where role='FK_TRAVELLE_REFERENCE_PAYMENT') thenalter table travellerdelete foreign key FK_TRAVELLE_REFERENCE_PAYMENT
end if;drop table if exists hotel;drop table if exists payment;drop table if exists reservation;drop table if exists room;drop table if exists traveller;/*==============================================================*/
/* Table: hotel */
/*==============================================================*/
create table hotel
(name text not null,location text not null,roomNum int not null,phoneNum int not null,constraint PK_HOTEL primary key clustered (name)
);/*==============================================================*/
/* Table: payment */
/*==============================================================*/
create table payment
(payId int not null,price float not null,payTime datetime not null,constraint PK_PAYMENT primary key clustered (payId)
);/*==============================================================*/
/* Table: reservation */
/*==============================================================*/
create table reservation
(reservationId int not null,name text null,payId int null,accountId text null,startDate date not null,endDate date not null,travellerId text not null,travellerPhone int not null,price float not null,state text not null,constraint PK_RESERVATION primary key clustered (reservationId)
);/*==============================================================*/
/* Table: room */
/*==============================================================*/
create table room
(roomNum int not null,state char not null,constraint PK_ROOM primary key clustered (roomNum)
);/*==============================================================*/
/* Table: traveller */
/*==============================================================*/
create table traveller
(accountId text not null,payId int null,password text not null,phoneNum int not null,constraint PK_TRAVELLER primary key clustered (accountId)
);alter table hoteladd constraint FK_HOTEL_REFERENCE_ROOM foreign key (roomNum)references room (roomNum)on update restricton delete restrict;alter table reservationadd constraint FK_RESERVAT_REFERENCE_HOTEL foreign key (name)references hotel (name)on update restricton delete restrict;alter table reservationadd constraint FK_RESERVAT_REFERENCE_PAYMENT foreign key (payId)references payment (payId)on update restricton delete restrict;alter table reservationadd constraint FK_RESERVAT_REFERENCE_TRAVELLE foreign key (accountId)references traveller (accountId)on update restricton delete restrict;alter table travelleradd constraint FK_TRAVELLE_REFERENCE_PAYMENT foreign key (payId)references payment (payId)on update restricton delete restrict;
相同点:都能简明清晰地表明数据表之间的关系,关注用例。
不同点:领域模型更关注功能,数据库更关注数据。
这篇关于系统分析与设计lesson7的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!