当前位置:网站首页>[designmode] flyweight pattern
[designmode] flyweight pattern
2022-07-07 16:36:00 【weixin_ forty-three million two hundred and twenty-four thousan】
Basic introduction
The flyweight pattern (Flyweight Pattern) Also called Flyweight Pattern : Using sharing technology to effectively support a large number of fine-grained objects
It is often used in the bottom development of the system , Solve the performance problem of the system . Like a database connection pool , There are all created connection objects , In these connection objects, we need to use them directly , Avoid recreating , If there is nothing we need , Then create a
The sharing mode can solve the problem of memory waste of duplicate objects , When there are a lot of similar objects in the system , When a buffer pool is needed . You don't have to always create new objects , It can be taken from the buffer pool . This can reduce system memory , Improve efficiency at the same time
The classic application scenario of the sharing mode is pool technology ,String Constant pool 、 Database connection pool 、 Buffer pool and so on are all applications of the sharing element mode , Sharing mode is an important way to implement pool technology
1. Show website project needs
Small outsourcing projects , To the customer A Make a product display website , Customer A My friends feel good , Also hope to do such a product display website , But the requirements are different :
Some customers request to release in the form of news
There are clients who want to blog
Some customers want to publish it in the form of WeChat official account
2. Traditional solution website show project
Copy and paste a copy directly , Then according to the different requirements of customers , Make custom changes
Rent a space for each website
Schematic diagram of scheme design
边栏推荐
- 修改配置文件后tidb无法启动
- Communication mode between application program and MATLAB
- Laravel service provider instance tutorial - create a service provider test instance
- Pycharm terminal enables virtual environment
- Three. JS series (1): API structure diagram-1
- Leetcode-231-2的幂
- Prometheus API deletes all data of a specified job
- 统计学习方法——感知机
- Leetcode-136-只出现一次的数(用异或来解答)
- Horizontal and vertical centering method and compatibility
猜你喜欢
The difference and working principle between compiler and interpreter
HAVE FUN | “飞船计划”活动最新进展
[designmode] proxy pattern
删除 console 语句引发的惨案
无法将“pip”项识别为 cmdlet、函数、脚本文件或可运行程序的名称
Binary search tree (features)
Cesium(3):ThirdParty/zip. js
Talk about the cloud deployment of local projects created by SAP IRPA studio
【医学分割】attention-unet
1亿单身男女“在线相亲”,撑起130亿IPO
随机推荐
Lecturer solicitation order | Apache seatunnel (cultivating) meetup sharing guests are in hot Recruitment!
Set the route and optimize the URL in thinkphp3.2.3
偶然升职的内心独白
HAVE FUN | “飞船计划”活动最新进展
Three. JS series (1): API structure diagram-1
JS 模块化
Common training data set formats for target tracking
How to query the data of a certain day, a certain month, and a certain year in MySQL
爬虫(17) - 面试(2) | 爬虫面试题库
PHP实现微信小程序人脸识别刷脸登录功能
AutoLISP series (3): function function 3
PHP中exit,exit(0),exit(1),exit(‘0’),exit(‘1’),die,return的区别
Pycharm terminal enables virtual environment
As an Android Developer programmer, Android advanced interview
Cesium (4): the reason why gltf model is very dark after loading
Opencv configuration 2019vs
iptables只允许指定ip地址访问指定端口
What is the difference between IP address and physical address
IP地址和物理地址有什么区别
[medical segmentation] attention Unet