当前位置:网站首页>[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
边栏推荐
- 提升工作效率工具:SQL批量生成工具思想
- The use of El cascader and the solution of error reporting
- FFMPEG关键结构体——AVFrame
- 20220703 周赛:知道秘密的人数-动规(题解)
- 云呐|固定资产管理系统功能包括哪些?
- PV static creation and dynamic creation
- Learn PWN from CTF wiki - ret2libc1
- How much do you know about the bank deposit business that software test engineers must know?
- Chapter 16 oauth2authorizationrequestredirectwebfilter source code analysis
- [binary search tree] add, delete, modify and query function code implementation
猜你喜欢
How much do you know about the bank deposit business that software test engineers must know?
Configuring OSPF load sharing for Huawei devices
Transport layer protocol ----- UDP protocol
Choose to pay tribute to the spirit behind continuous struggle -- Dialogue will values [Issue 4]
Huawei equipment configuration ospf-bgp linkage
云呐|固定资产管理系统功能包括哪些?
What are the functions of Yunna fixed assets management system?
GD32F4xx uIP协议栈移植记录
QT QPushButton details
Bao Yan notes II software engineering and calculation volume II (Chapter 13-16)
随机推荐
Chapter 16 oauth2authorizationrequestredirectwebfilter source code analysis
Online yaml to CSV tool
5. Logistic regression
硬件及接口学习总结
Open3D 点云随机添加噪声
Hardware and interface learning summary
20220703 周赛:知道秘密的人数-动规(题解)
MySql——CRUD
【在线聊天】原来微信小程序也能回复Facebook主页消息!
[binary search tree] add, delete, modify and query function code implementation
2022.7.5-----leetcode. seven hundred and twenty-nine
Transport layer protocol ----- UDP protocol
FFMPEG关键结构体——AVFrame
传输层协议------UDP协议
MySQL之函数
14 MySQL view
Tools to improve work efficiency: the idea of SQL batch generation tools
提升工作效率工具:SQL批量生成工具思想
GD32F4xx uIP协议栈移植记录
Choose to pay tribute to the spirit behind continuous struggle -- Dialogue will values [Issue 4]