系统分析与设计作业5

系统分析与设计作业5

  • 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:32:11                           */

/==============================================================/

drop table if exists CreditCard;

drop table if exists Customer;

drop table if exists Hotel;

drop table if exists "Order";

drop table if exists Room;

/==============================================================/

/* Table: CreditCard                                            */

/==============================================================/

create table CreditCard

(

   account              int(18) not null,

   orderID              int(15),

   password             int(6),

   information          char,

   primary key (account)

);

/==============================================================/

/* Table: Customer                                              */

/==============================================================/

create table Customer

(

   id                   int(15) not null,

   account              int(18),

   orderID              int(15),

   name                 char(50),

   email                varchar,

   "is smoke"           boolean,

   hotelID              int(15),

   primary key (id)

);

/==============================================================/

/* Table: Hotel                                                 */

/==============================================================/

create table Hotel

(

   hotelID              int(15) not null,

   roomID               int(5),

   city                 char,

   information          char,

   primary key (hotelID)

);

/==============================================================/

/* Table: "Order"                                               */

/==============================================================/

create table "Order"

(

   orderID              int(15) not null,

   "check in"           char,

   "check out"          char,

   roomID               int(5),

   price                float,

   primary key (orderID)

);

/==============================================================/

/* Table: Room                                                  */

/==============================================================/

create table Room

(

   type                 char,

   roomID               int(5) not null,

   hotelID              int(15),

   primary key (roomID)

);

alter table CreditCard add constraint FK_Reference_5 foreign key (orderID)

      references "Order" (orderID) on delete restrict on update restrict;

alter table Customer add constraint FK_Reference_1 foreign key (account)

      references CreditCard (account) on delete restrict on update restrict;

alter table Customer add constraint FK_Reference_4 foreign key (orderID)

      references "Order" (orderID) on delete restrict on update restrict;

alter table Hotel add constraint FK_Reference_3 foreign key (roomID)

      references Room (roomID) on delete restrict on update restrict;

alter table "Order" add constraint FK_Reference_6 foreign key (roomID)

      references Room (roomID) on delete restrict on update restrict;
  • 数据库逻辑模型与领域模型的异同:两者都是类的抽象,抽象出主要的类,描述不同类之间的关系。
    领域模型只是一个概念的描述,其中的属性不涉及到其具体类型与实现。数据库逻辑模型涉及到更多的细节部分,涉及到数据库的具体实现,而领域模型与数据库的具体实现没有很大的联系。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值