系统分析与设计作业(五)

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:      MySQL 5.0                                    */
/* Created on:     2018/4/29 21:57:50                           */
/*==============================================================*/


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
(
   location             text,
   name                 varchar(1024) not null,
   TravellerID          char(20),
   primary key (name)
);

alter table Hotel comment 'Hotel';

/*==============================================================*/
/* Table: Payment                                               */
/*==============================================================*/
create table Payment
(
   redictCard           text not null,
   TravellerID          char(20),
   cost                 int,
   primary key (redictCard)
);

alter table Payment comment 'Payment';

/*==============================================================*/
/* Table: Reservation                                           */
/*==============================================================*/
create table Reservation
(
   hotel                char(20),
   room                 numeric(8,0) not null,
   TravellerID          char(20),
   date                 date,
   primary key (room)
);

alter table Reservation comment 'Reservation';

/*==============================================================*/
/* Table: Room                                                  */
/*==============================================================*/
create table Room
(
   type                 text,
   price                int,
   number               numeric(8,0) not null,
   name                 varchar(1024),
   primary key (number)
);

alter table Room comment 'Room';

/*==============================================================*/
/* Table: Traveller                                             */
/*==============================================================*/
create table Traveller
(
   TravellerID          char(20) not null,
   location             text,
   email                longtext not null,
   primary key (TravellerID)
);

alter table Traveller comment 'Traveller';

alter table Hotel add constraint FK_choose foreign key (TravellerID)
      references Traveller (TravellerID) on delete restrict on update restrict;

alter table Payment add constraint FK_make_2 foreign key (TravellerID)
      references Traveller (TravellerID) on delete restrict on update restrict;

alter table Reservation add constraint FK_make_1 foreign key (TravellerID)
      references Traveller (TravellerID) on delete restrict on update restrict;

alter table Room add constraint FK_has foreign key (name)
      references Hotel (name) on delete restrict on update restrict;


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

逻辑模型,是指数据的逻辑结构。是将概念模型转化为具体的数据模型的过程逻辑建模是数据仓库实施中的重要一环,因为它能直接反映出业务部门的需求,同时对系统的物理实施有着重要的指导作用,它的作用在于可以通过实体和关系勾勒出企业的数据蓝图。

领域模型考虑的是除系统和UI实体之外的实体,数据库逻辑模型考虑的是能够在数据库中存储的非暂时性的实体。领域模型创建实体的过程中允许实体使用相同的编码和名称在逻辑模型中则不允许,否则会报错。


猜你喜欢

转载自blog.csdn.net/qq_34200964/article/details/80144252