系统分析与设计lesson7

本文介绍了一个酒店预订系统的数据库设计过程,包括城市、信用卡、客户、酒店、预订和房间等六个核心表的设计,并阐述了这些表之间的外键约束关系。此外,还对比了数据库逻辑模型与领域模型的主要区别。

领域建模


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

    

2.      数据库建模(E-R 模型)

  •     按 Task 3 要求,给出系统的 E-R 模型

    

  •     导出 Mysql 物理数据库的脚本

    drop table if exists City;
 
drop table if exists "Credit card";
 
drop table if exists Customer;
 
drop table if exists Hotel;
 
drop table if exists Reservation;
 
drop table if exists Room;
 
/*==============================================================*/
/* Table: City                                                  */
/*==============================================================*/
create table City
(
   city_id              int not null,
   city_name            varchar(100) not null,
   primary key (city_id)
);
 
/*==============================================================*/
/* Table: "Credit card"                                         */
/*==============================================================*/
create table "Credit card"
(
   card_id              int not null,
   bank_name            longtext not null,
   owner                varchar(50) not null,
   phone_num            char(20),
   security_code        char(10),
   primary key (card_id)
);
 
/*==============================================================*/
/* Table: Customer                                              */
/*==============================================================*/
create table Customer
(
   customer_id          int not null,
   card_id              int,
   customer_name        varchar(50) not null,
   email_address        longtext not null,
   primary key (customer_id)
);
 
/*==============================================================*/
/* Table: Hotel                                                 */
/*==============================================================*/
create table Hotel
(
   hotel_id             int not null,
   city_id              int,
   room_id              int,
   hotel_name           varchar(100) not null,
   primary key (hotel_id)
);
 
/*==============================================================*/
/* Table: Reservation                                           */
/*==============================================================*/
create table Reservation
(
   book_id              int not null,
   hotel_id             int,
   room_id              int,
   customer_id          int,
   check_in_date        varchar(50) not null,
   check_out_date       varchar(50) not null,
   primary key (book_id)
);
 
/*==============================================================*/
/* Table: Room                                                  */
/*==============================================================*/
create table Room
(
   room_id              int not null,
   room_type            int not null,
   price                int not null,
   is_available_now     bool not null,
   primary key (room_id)
);
 
alter table Customer add constraint FK_Reference_6 foreign key (card_id)
      references "Credit card" (card_id) on delete restrict on update restrict;
 
alter table Hotel add constraint FK_Reference_1 foreign key (city_id)
      references City (city_id) on delete restrict on update restrict;
 
alter table Hotel add constraint FK_Reference_2 foreign key (room_id)
      references Room (room_id) on delete restrict on update restrict;
 
alter table Reservation add constraint FK_Reference_3 foreign key (hotel_id)
      references Hotel (hotel_id) on delete restrict on update restrict;
 
alter table Reservation add constraint FK_Reference_4 foreign key (room_id)
      references Room (room_id) on delete restrict on update restrict;
 
alter table Reservation add constraint FK_Reference_5 foreign key (customer_id)
      references Customer (customer_id) on delete restrict on update restrict;

  • 简单叙说 数据库逻辑模型与领域模型的异同

        数据库逻辑模型从数据需求分析出系统的额实体属性图,对实体之间的依赖关机进行整合,由实体,属性和联系组成。

        数据库逻辑模型的定义用来表示存储于某处的持久性数据,且其建立与软件开发工作密切相关,是设计阶段的必需工作;而领域模型反映的是现实世界中对象的概念透视图,与业务逻辑相关,同领域中相似业务可能具有类似的领域模型

    领域模型是对领域内的概念类或现实世界中对象的可视化表示。

    在领域模型里,并不会排除需求中没有明确要求记录其相关信息的类,而数据库逻辑模型则必须完成该排除工作,同时领域模型也不会排除没有属性的概念类。










《基于PHP架构的校园住宿管理平台构建方案》 本方案提出运用PHP编程语言构建校园住宿资源管理平台,旨在优化校园住宿资源配置效率,强化住宿环境监管能力。PHP作为具备跨平台特性的开源脚本语言,在Web应用开发领域具有明显的技术优势,其快速开发特性较低的学习门槛为系统实施提供了技术保障。 在数据架构设计层面,平台建立了多维数据表结构:学生基本信息表(含学号、姓名、性别及所属班级等字段)、宿舍资源表(包含宿舍编号、床位容量、地理位置等参数)以及住宿分配关系表(记录学生宿舍的对应关系)。通过结构化查询语言实现数据的精准操作维护。 核心功能模块包含以下五个维度: 1. 学生档案管理子系统 2. 宿舍资源维护空置率统计模块 3. 基于班级建制性别特征的智能分房算法 4. 多维数据可视化报表系统(入住率趋势分析、住宿分布热力图) 5. 基于角色权限的访问控制机制(区分系统管理员班主任操作权限) 技术架构采用模型-视图-控制器设计范式,有效实现业务逻辑表现层的分离。视图层负责数据呈现,控制层处理业务请求并调度模型层,模型层封装所有数据持久化操作。 前端界面综合运用HTML5、CSS3及JavaScript技术栈,通过异步JavaScript和XML技术实现无刷新数据交互。安全防护体系包含输入参数验证机制、SQL注入防护策略、密码哈希加密存储及定期数据备份方案,确保系统运行安全可靠。 该平台显著提升了校园住宿管理工作的规范化水平,体现了信息化技术在教育管理领域的深度应用价值,构建了安全稳定、运行高效的数字管理生态。 资源来源于网络分享,仅用于学习交流使用,请勿用于商业,如有侵权请联系我删除!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值