【系统分析与设计】lesson7

  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/24 19:25:11                           */
/*==============================================================*/


drop table if exists t_card;

drop table if exists t_cardhoder;

drop table if exists t_city;

drop table if exists t_customer;

drop table if exists t_hotel;

drop table if exists t_order;

/*==============================================================*/
/* Table: t_card                                                */
/*==============================================================*/
create table t_card
(
   email                longtext not null,
   card_number          char(10),
   card_security_code   char(10),
   expiry_date          char(10),
   primary key (email)
);

/*==============================================================*/
/* Table: t_cardhoder                                           */
/*==============================================================*/
create table t_cardhoder
(
   title                longtext,
   first_name           longtext,
   last_name            longtext,
   address1             longtext,
   address2             longtext,
   city                 longtext,
   state                longtext,
   country              longtext,
   postcode             longtext,
   evening_telephone    longtext,
   email                longtext not null,
   primary key (email)
);

/*==============================================================*/
/* Table: t_city                                                */
/*==============================================================*/
create table t_city
(
   city                 longtext,
   hotel                longtext not null,
   primary key (hotel)
);

/*==============================================================*/
/* Table: t_customer                                            */
/*==============================================================*/
create table t_customer
(
   full_name            longtext,
   email                longtext not null,
   special_requirement  text,
   smoking              bool,
   primary key (email)
);

/*==============================================================*/
/* Table: t_hotel                                               */
/*==============================================================*/
create table t_hotel
(
   hotel                longtext,
   room                 longtext not null,
   primary key (room)
);

/*==============================================================*/
/* Table: t_order                                               */
/*==============================================================*/
create table t_order
(
   room                 longtext not null,
   t_c_email            longtext,
   time                 date,
   email                bool,
   primary key (room)
);

alter table t_card add constraint FK_Reference_1 foreign key (email)
      references t_customer (email) on delete restrict on update restrict;

alter table t_cardhoder add constraint FK_Reference_6 foreign key (email)
      references t_card (email) on delete restrict on update restrict;

alter table t_hotel add constraint FK_Reference_2 foreign key (hotel)
      references t_city (hotel) on delete restrict on update restrict;

alter table t_order add constraint FK_Reference_3 foreign key (room)
      references t_hotel (room) on delete restrict on update restrict;

alter table t_order add constraint FK_Reference_4 foreign key (t_c_email)
      references t_customer (email) on delete restrict on update restrict;

数据库逻辑模型 与 领域模型 区别:
数据模型是系统设计,以及实现的一部分,描述的是对用户需求在技术上的实现方法。用户不需要关心系统的数据模型,但是必须关注领域模型,因为领域模型反映的是问题域的相关业务概念以及其关系,领域模型是用户业务描述的高度抽象,来源于业务需求的描述,同时又可以帮助用户和需求分析人员更好的理解业务需求。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值