当前位置:网站首页>[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
边栏推荐
- 亲测可用fiddler手机抓包配置代理后没有网络
- 传输层协议------UDP协议
- Zhongjun group launched electronic contracts to accelerate the digital development of real estate enterprises
- 5. Logistic regression
- Spire Office 7.5.4 for NET
- Choose to pay tribute to the spirit behind continuous struggle -- Dialogue will values [Issue 4]
- Tools to improve work efficiency: the idea of SQL batch generation tools
- Open source CRM customer relationship system management system source code, free sharing
- Learn PWN from CTF wiki - ret2libc1
- Initialiser votre vecteur & initialisateur avec une liste Introduction à la Liste
猜你喜欢
Permission problem: source bash_ profile permission denied
Zhongjun group launched electronic contracts to accelerate the digital development of real estate enterprises
[online chat] the original wechat applet can also reply to Facebook homepage messages!
Single merchant v4.4 has the same original intention and strength!
The difference of time zone and the time library of go language
MySql——CRUD
Initialiser votre vecteur & initialisateur avec une liste Introduction à la Liste
China Jinmao online electronic signature, accelerating the digitization of real estate business
Rsync remote synchronization
Configuring OSPF load sharing for Huawei devices
随机推荐
What are Yunna's fixed asset management systems?
认识提取与显示梅尔谱图的小实验(观察不同y_axis和x_axis的区别)
Mathematical model Lotka Volterra
Configuring OSPF GR features for Huawei devices
Open3D 点云随机添加噪声
亲测可用fiddler手机抓包配置代理后没有网络
Choose to pay tribute to the spirit behind continuous struggle -- Dialogue will values [Issue 4]
Add noise randomly to open3d point cloud
【LeetCode】5. Valid palindrome
Use mapper: --- tkmapper
How much do you know about the bank deposit business that software test engineers must know?
Senparc.Weixin.Sample.MP源码剖析
Problem solving win10 quickly open ipynb file
Miaochai Weekly - 8
Russian Foreign Ministry: Japan and South Korea's participation in the NATO summit affects security and stability in Asia
4 points tell you the advantages of the combination of real-time chat and chat robots
Spire. PDF for NET 8.7.2
Bao Yan notebook IV software engineering and calculation volume II (Chapter 8-12)
Asynchronous task Whenall timeout - Async task WhenAll with timeout
GD32F4xx uIP协议栈移植记录