系统分析与设计 lesson7作业

本文探讨了领域模型与数据库逻辑模型的区别与联系,并通过具体案例展示了如何进行实体关系建模(E-R模型)。文中详细介绍了使用PowerDesigner创建E-R模型的过程及MySQL数据库脚本。

  • a. 阅读 Asg_RH 文档,按用例构建领域模型。
    • 按 Task2 要求,请使用工具 UMLet,截图格式务必是 png 并控制尺寸
    • 说明:请不要受 PCMEF 层次结构影响。你需要识别实体(E)和 中介实体(M,也称状态实体)
      • 在单页面应用(如 vue)中,E 一般与数据库构建有关, M 一般与 store 模式 有关
      • 在 java web 应用中,E 一般与数据库构建有关, M 一般与 session 有关



导出数据库脚本:

/*==============================================================*/
/* DBMS name:      MySQL 5.0                                    */
/* Created on:     2018/4/26 21:04:27                           */
/*==============================================================*/


drop table if exists creditCard;

drop table if exists hotel;

drop table if exists room;

drop table if exists traveller;

/*==============================================================*/
/* Table: creditCard                                            */
/*==============================================================*/
create table creditCard
(
   ID                   longblob,
   cardDetail           longtext not null,
   paymentDetail        char(1) not null
);

/*==============================================================*/
/* Table: hotel                                                 */
/*==============================================================*/
create table hotel
(
   location             longtext,
   availableTime        datetime,
   HotelID              int not null,
   primary key (HotelID)
);

/*==============================================================*/
/* Table: room                                                  */
/*==============================================================*/
create table room
(
   HotelID              int,
   avaliableTime        datetime,
   roomType             longtext not null,
   roomID               int not null,
   ID                   longblob,
   primary key (roomID)
);

/*==============================================================*/
/* Table: traveller                                             */
/*==============================================================*/
create table traveller
(
   name                 longtext not null,
   emailAddress         longtext not null,
   ID                   longblob not null,
   HotelID              int,
   primary key (ID)
);

alter table creditCard add constraint FK_Reference_2 foreign key (ID)
      references traveller (ID) on delete restrict on update restrict;

alter table room add constraint FK_Reference_4 foreign key (HotelID)
      references hotel (HotelID) on delete restrict on update restrict;

alter table room add constraint FK_Reference_5 foreign key (ID)
      references traveller (ID) on delete restrict on update restrict;

alter table traveller add constraint FK_Reference_3 foreign key (HotelID)
      references hotel (HotelID) on delete restrict on update restrict;

 数据库逻辑模型 与 领域模型 的异同:

数据库逻辑模型需要考虑一些更加细节的东西,比如每个实体的属性,主键是什么,某个实体跟其他实体是什么关系等等,同时中间态的实体也不再出现,比如Mshoppingbasket,为了确保还要考虑一些属性要放在哪,是否需要冗余的问题,总之数据库逻辑建模会更偏向于实践而不再是概念的建模。
数据模型是系统设计,以及实现的一部分,描述的是对用户需求在技术上的实现方法。用户不需要关心系统的数据模型,但是必须关注领域模型,因为领域模型反映的是问题域的相关业务概念以及其关系,领域模型是用户业务描述的高度抽象,来源于业务需求的描述,同时又可以帮助用户和需求分析人员更好的理解业务需求。

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值