当前位置:网站首页>[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
边栏推荐
- AutoLISP series (1): function function 1
- Leetcode-231-2的幂
- Three. JS series (2): API structure diagram-2
- Sysom case analysis: where is the missing memory| Dragon lizard Technology
- Lecturer solicitation order | Apache seatunnel (cultivating) meetup sharing guests are in hot Recruitment!
- 修改配置文件后tidb无法启动
- Multiplication in pytorch: mul (), multiply (), matmul (), mm (), MV (), dot ()
- JS modularization
- time标准库
- Tragedy caused by deleting the console statement
猜你喜欢
Three. JS series (2): API structure diagram-2
Odoo integrated plausible embedded code monitoring platform
Tragedy caused by deleting the console statement
全网“追杀”钟薛高
Logback logging framework third-party jar package is available for free
Binary search tree (basic operation)
Talk about the cloud deployment of local projects created by SAP IRPA studio
【MySql进阶】索引详解(一):索引数据页结构
Advanced C language -- function pointer
[vulnhub range] thales:1
随机推荐
【DesignMode】享元模式(Flyweight Pattern)
Cesium(3):ThirdParty/zip. js
laravel 是怎么做到运行 composer dump-autoload 不清空 classmap 映射关系的呢?
Laravel changed the session from file saving to database saving
Find tags in prefab in unity editing mode
null == undefined
面试题 01.02. 判定是否互为字符重排-辅助数组算法
URL和URI的关系
Iptables only allows the specified IP address to access the specified port
Xcode Revoke certificate
水平垂直居中 方法 和兼容
three. JS create cool snow effect
[medical segmentation] attention Unet
【DesignMode】外观模式 (facade patterns)
统计学习方法——感知机
Binary search tree (basic operation)
[designmode] facade patterns
torch. Numel action
How does laravel run composer dump autoload without emptying the classmap mapping relationship?
TiDB For PostgreSQL和YugabyteDB在Sysbench上的性能对比