系统分析与设计-homework5

  • 领域建模

    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 或开源工具 OpenSystemArchitect
    导出 Mysql 物理数据库的脚本

/*==============================================================*/
/* DBMS name:      Sybase SQL Anywhere 12                       */
/* Created on:     2018/4/30 0:10:03                            */
/*==============================================================*/


if exists(select 1 from sys.sysforeignkey where role='FK_CUSTOMER_REFERENCE_HOTEL') then
    alter table Customer
       delete foreign key FK_CUSTOMER_REFERENCE_HOTEL
end if;

if exists(select 1 from sys.sysforeignkey where role='FK_RESERVAT_REFERENCE_ROOM') then
    alter table Reservation
       delete foreign key FK_RESERVAT_REFERENCE_ROOM
end if;

if exists(select 1 from sys.sysforeignkey where role='FK_RESERVAT_REFERENCE_CUSTOMER') then
    alter table Reservation
       delete foreign key FK_RESERVAT_REFERENCE_CUSTOMER
end if;

if exists(select 1 from sys.sysforeignkey where role='FK_ROOM_REFERENCE_HOTEL') then
    alter table Room
       delete foreign key FK_ROOM_REFERENCE_HOTEL
end if;

drop table if exists Customer;

drop table if exists Hotel;

drop table if exists Reservation;

drop table if exists Room;

/*==============================================================*/
/* Table: Customer                                              */
/*==============================================================*/
create table Customer 
(
   "Customer ID"        integer                        not null,
   "Hotel ID"           integer                        null,
   name                 char(50)                       null,
   phone                char(50)                       null,
   constraint PK_CUSTOMER primary key clustered ("Customer ID")
);

/*==============================================================*/
/* Table: Hotel                                                 */
/*==============================================================*/
create table Hotel 
(
   "Hotel ID"           integer                        not null,
   name                 char(50)                       null,
   price                varchar(50)                    null,
   location             char(50)                       null,
   constraint PK_HOTEL primary key clustered ("Hotel ID")
);

/*==============================================================*/
/* Table: Reservation                                           */
/*==============================================================*/
create table Reservation 
(
   "Reservation ID"     integer                        not null,
   "Room ID"            integer                        null,
   "Customer ID"        integer                        null,
   "Customer info"      char(50)                       null,
   "Room info"          char(50)                       null,
   checkin_data         char(50)                       null,
   checkout_data        char(50)                       null,
   constraint PK_RESERVATION primary key clustered ("Reservation ID")
);

/*==============================================================*/
/* Table: Room                                                  */
/*==============================================================*/
create table Room 
(
   "Room ID"            integer                        not null,
   "Hot_Hotel ID"       integer                        null,
   type                 char(50)                       null,
   price                integer                        null,
   "Hotel ID"           char(50)                       null,
   constraint PK_ROOM primary key clustered ("Room ID")
);

alter table Customer
   add constraint FK_CUSTOMER_REFERENCE_HOTEL foreign key ("Hotel ID")
      references Hotel ("Hotel ID")
      on update restrict
      on delete restrict;

alter table Reservation
   add constraint FK_RESERVAT_REFERENCE_ROOM foreign key ("Room ID")
      references Room ("Room ID")
      on update restrict
      on delete restrict;

alter table Reservation
   add constraint FK_RESERVAT_REFERENCE_CUSTOMER foreign key ("Customer ID")
      references Customer ("Customer ID")
      on update restrict
      on delete restrict;

alter table Room
   add constraint FK_ROOM_REFERENCE_HOTEL foreign key ("Hot_Hotel ID")
      references Hotel ("Hotel ID")
      on update restrict
      on delete restrict;


简单叙说数据库逻辑模型与领域模型的异同

相同:都是用来抽象出主要的类,描述不同类之间的关系,从而辅助分析与设计。

不同处:领域模型是对用户业务的领域描述的高度抽象,可以帮助需求分析人员快速熟悉目标领域的词汇和操作,从而更好的理解业务需求;不涉及到具体的实现。但数据库逻辑模型涉及到数据库的具体实现,对象是实体和关系(ER),描述了具体的实现方法。
此外,用户只需要关心领域模型,开发人员通过领域模型的描述,构建数据库逻辑模型。

1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 、4下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。、可私 6信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 、4下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。、可 6私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 、4下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。、可私 6信博主看论文后选择购买源代码。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值