系统分析与设计-lesson7

  • a.阅读 Asg_RH 文档,按用例构建领域模型。

    • 按Task2 要求,请使用工具 UMLet,截图格式务必是 png 并控制尺寸
    • 说明:请不要受 PCMEF 层次结构影响。你需要识别实体(E)和 中介实体(M,也称状态实体)
      这里写图片描述
  • b.数据库建模(E-R 模型)

    • 按 Task 3 要求,给出系统的 E-R 模型(数据逻辑模型)
    • 建模工具 PowerDesigner(简称PD) 或开源工具 OpenSystemArchitect
    • 不负责的链接:http://www.cnblogs.com/mcgrady/archive/2013/05/25/3098588.html
    • 导出 Mysql 物理数据库的脚本
    • 简单叙说 数据库逻辑模型 与 领域模型 的异同
      这里写图片描述
      导出的sql语句如下:
/*==============================================================*/
/* DBMS name:      Sybase SQL Anywhere 12                       */
/* Created on:     2018/4/28 22:00:56                           */
/*==============================================================*/


if exists(select 1 from sys.sysforeignkey where role='FK_CREDITCA_REFERENCE_USER') then
    alter table CreditCard
       delete foreign key FK_CREDITCA_REFERENCE_USER
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;

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

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

drop table if exists CreditCard;

drop table if exists hotel;

drop table if exists room;

drop table if exists "user";

/*==============================================================*/
/* Table: CreditCard                                            */
/*==============================================================*/
create table CreditCard 
(
   id                   numeric(15)                    null,
   card_info            varchar(50)                    null,
   pay_info             varchar(100)                   null
);

/*==============================================================*/
/* Table: hotel                                                 */
/*==============================================================*/
create table hotel 
(
   hotelID              numeric(10)                    not null,
   address              varchar(100)                   null,
   phone                numeric(15)                    null,
   constraint PK_HOTEL primary key clustered (hotelID)
);

/*==============================================================*/
/* Table: room                                                  */
/*==============================================================*/
create table room 
(
   room_id              numeric(5)                     not null,
   id                   numeric(15)                    null,
   hotelID              numeric(10)                    null,
   "date"               date                           null,
   "order"              smallint                       null,
   constraint PK_ROOM primary key clustered (room_id)
);

/*==============================================================*/
/* Table: "user"                                                */
/*==============================================================*/
create table "user" 
(
   id                   numeric(15)                    not null,
   name                 varchar(50)                    null,
   phone                numeric(15)                    null,
   email                varchar(50)                    null,
   hotelID              numeric(10)                    null,
   constraint PK_USER primary key clustered (id)
);

alter table CreditCard
   add constraint FK_CREDITCA_REFERENCE_USER foreign key (id)
      references "user" (id)
      on update restrict
      on delete restrict;

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

alter table room
   add constraint FK_ROOM_REFERENCE_USER foreign key (id)
      references "user" (id)
      on update restrict
      on delete restrict;

alter table "user"
   add constraint FK_USER_REFERENCE_HOTEL foreign key (hotelID)
      references hotel (hotelID)
      on update restrict
      on delete restrict;

对于数据逻辑模型,在数据仓库中,总的来说数据仓库的结构采用了三级数据模型的方式,即概念模型、逻辑模型、物理模型。其中,逻辑模型:用来构建数据仓库的数据库逻辑模型。根据分析系统的实际需求决策构建数据库逻辑关系模型,定义数据库物体结构及其关系。它关联着数据仓库的逻辑模型和物理模型两方。

而对于领域模型,领域模型是对领域内的概念类或现实世界中对象的可视化表示。又称概念模型、领域对象模型、分析对象模型。它专注于分析问题领域本身,发掘重要的业务领域概念,并建立业务领域概念之间的关系。

猜你喜欢

转载自blog.csdn.net/sysu_xiandan/article/details/80138919