Skip to content

Commit

Permalink
hzuapps#4 hzuapps#5 hzuapps#167 实验四五:类建模
Browse files Browse the repository at this point in the history
  • Loading branch information
luxiaoshanhhh authored Mar 23, 2020
1 parent 5c2442f commit 31dea7d
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions students/1709081602603/lab4_5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 实验四五:类建模
## 一、实验目标
1. 掌握类建模方法
2. 了解MVC或你熟悉的设计模式
3. 掌握类图的画法
4. 理解类的5种关系;
5. 掌握类之间关系的画法。

## 二、实验步骤
1. 根据用例规约确定每个用例需要建立哪些类
2. 绘制类图
查词用例:查词控制器(C)、单词(M)、查词页面(V)
添加生词用例:添加生词控制器(C)、单词(M)、添加生词页面(V)
3. 确定类之间的关系,连接各个类图

## 三、实验结果
![查词的类图](./cd1.JPG)
图1:查词的类图
![添加生词的类图](./cd2.JPG)
图2:添加生词的类图

## 四、课堂笔记
1. 类的描述包括状态和行为(属性和操作),在UML中类图用矩形表示,矩形=名称+属性+操作
2. 类的可见性:public、private、protected、package
3. 类之间的关系有:
依赖Dependency(类间关系弱。类间关系越弱越好,这样容易修改)
关联Association
聚合Aggregation
组合Composition
继承Inheritance(类间关系强)
4. MVC设计模式:
Model:模型、实体、业务数据
View:视图、界面
Controller:控制器、系统、Service

0 comments on commit 31dea7d

Please sign in to comment.