当前位置:网站首页>[designmode] composite mode
[designmode] composite mode
2022-07-06 00:00:00 【weixin_ forty-three million two hundred and twenty-four thousan】
Basic introduction
Portfolio model (Composite Pattern), Also known as part of the overall model , It creates a tree structure of object groups , Combine objects into a tree structure to represent “ whole - part ” The hierarchy of .
Combining patterns combine objects according to a tree structure , Used to represent part and whole level .
This type of design pattern belongs to structural pattern .
The combination mode makes the access of users to single object and combination object consistent , namely : Composition allows customers to deal with individual objects and composite objects in a consistent way
1. Look at the display needs of a school department
Write a program to show the structure of a school :
This is the demand , To show the composition of the school department in a page , There are many colleges in a school , A college has many departments . Pictured :
2. Display of traditional solutions in schools and departments ( Class diagram )
3. Traditional solutions to the problems existing in the display of schools and departments
Think of the college as a subclass of the school , The Department is a subclass of the college , In fact, this is based on the size of the organization
In fact, our request is : Show the composition of the school department in a page , There are many colleges in a school , A college has many departments , So this program , Management operations that cannot be well implemented , Than
边栏推荐
- Wechat applet -- wxml template syntax (with notes)
- Problem solving win10 quickly open ipynb file
- 云呐|固定资产管理系统功能包括哪些?
- FFT 学习笔记(自认为详细)
- 20220703 week race: number of people who know the secret - dynamic rules (problem solution)
- 14 MySQL-视图
- Add noise randomly to open3d point cloud
- Breadth first search open turntable lock
- GD32F4xx uIP协议栈移植记录
- 数据库遇到的问题
猜你喜欢
XML配置文件(DTD详细讲解)
FFMPEG关键结构体——AVFormatContext
18.(arcgis api for js篇)arcgis api for js点采集(SketchViewModel)
el-cascader的使用以及报错解决
Zhongjun group launched electronic contracts to accelerate the digital development of real estate enterprises
Configuring OSPF load sharing for Huawei devices
Mathematical model Lotka Volterra
Huawei equipment configuration ospf-bgp linkage
MySQL之函数
Qt QPushButton详解
随机推荐
GFS分布式文件系統
15 MySQL stored procedures and functions
认识提取与显示梅尔谱图的小实验(观察不同y_axis和x_axis的区别)
C file and folder operation
Configuring OSPF load sharing for Huawei devices
Wechat applet -- wxml template syntax (with notes)
如何让同步/刷新的图标(el-icon-refresh)旋转起来
时区的区别及go语言的time库
[binary search tree] add, delete, modify and query function code implementation
2022.7.5-----leetcode.729
用列表初始化你的vector&&initializer_list简介
What if the C disk is not enough? Let's see how I can clean up 25g of temp disk space after I haven't redone the system for 4 years?
Doppler effect (Doppler shift)
Breadth first search open turntable lock
MySQL global lock and table lock
FFMPEG关键结构体——AVCodecContext
【luogu CF487E】Tourists(圆方树)(树链剖分)(线段树)
什么叫做信息安全?包含哪些内容?与网络安全有什么区别?
China Jinmao online electronic signature, accelerating the digitization of real estate business
Transport layer protocol ----- UDP protocol