当前位置:网站首页>[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
边栏推荐
- 7.5 simulation summary
- 认识提取与显示梅尔谱图的小实验(观察不同y_axis和x_axis的区别)
- Upgrade openssl-1.1.1p for openssl-1.0.2k
- 20220703 周赛:知道秘密的人数-动规(题解)
- 什么叫做信息安全?包含哪些内容?与网络安全有什么区别?
- 微信小程序---WXML 模板语法(附带笔记文档)
- Use mapper: --- tkmapper
- Teach you to run uni app with simulator on hbuilderx, conscience teaching!!!
- VBA fast switching sheet
- C# 文件与文件夹操作
猜你喜欢
FFT 学习笔记(自认为详细)
Configuring OSPF load sharing for Huawei devices
【NOI模拟赛】Anaid 的树(莫比乌斯反演,指数型生成函数,埃氏筛,虚树)
The difference of time zone and the time library of go language
"14th five year plan": emphasis on the promotion of electronic contracts, electronic signatures and other applications
Senparc.Weixin.Sample.MP源码剖析
妙才周刊 - 8
What are the functions of Yunna fixed assets management system?
激光slam学习记录
18.(arcgis api for js篇)arcgis api for js点采集(SketchViewModel)
随机推荐
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?
How to get all the values stored in localstorage
Which side projects can be achieved? Is it difficult for we media to earn more than 10000 a month?
【LeetCode】5. Valid palindrome
同事悄悄告诉我,飞书通知还能这样玩
Configuring OSPF load sharing for Huawei devices
教你在HbuilderX上使用模拟器运行uni-app,良心教学!!!
FFmpeg学习——核心模块
云呐|公司固定资产管理系统有哪些?
JS 这次真的可以禁止常量修改了!
Huawei equipment configuration ospf-bgp linkage
After summarizing more than 800 kubectl aliases, I'm no longer afraid that I can't remember commands!
Single merchant v4.4 has the same original intention and strength!
[QT] QT uses qjson to generate JSON files and save them
15 MySQL-存储过程与函数
Initialiser votre vecteur & initialisateur avec une liste Introduction à la Liste
多普勒效应(多普勒频移)
转:未来,这样的组织才能扛住风险
[EF core] mapping relationship between EF core and C data type
用列表初始化你的vector&&initializer_list简介