当前位置:网站首页>[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
边栏推荐
- PHP has its own filtering and escape functions
- iptables只允许指定ip地址访问指定端口
- Leetcode-136- number that appears only once (solve with XOR)
- AutoLISP series (3): function function 3
- 面向接口编程
- [Android -- data storage] use SQLite to store data
- Odoo integrated plausible embedded code monitoring platform
- Usage of config in laravel
- Record the migration process of a project
- [designmode] facade patterns
猜你喜欢
Opencv personal notes
无法将“pip”项识别为 cmdlet、函数、脚本文件或可运行程序的名称
记录Servlet学习时的一次乱码
Power of leetcode-231-2
【C 语言】 题集 of Ⅹ
预售17.9万,恒驰5能不能火?产品力在线,就看怎么卖
Cesium(3):ThirdParty/zip. js
Talk about the cloud deployment of local projects created by SAP IRPA studio
Three. JS series (1): API structure diagram-1
3000 words speak through HTTP cache
随机推荐
[hcsd celebrity live broadcast] teach the interview tips of big companies in person - brief notes
【DesignMode】模板方法模式(Template method pattern)
What are compiled languages and interpreted languages?
Talk about the cloud deployment of local projects created by SAP IRPA studio
PHP实现执行定时任务的几种思路详解
MySQL中, 如何查询某一天, 某一月, 某一年的数据
Asyncio concept and usage
JS modularization
Three. JS series (2): API structure diagram-2
Opencv configuration 2019vs
Usage of config in laravel
laravel post提交数据时显示异常
laravel构造函数和中间件执行顺序问题
95.(cesium篇)cesium动态单体化-3D建筑物(楼栋)
Power of leetcode-231-2
JS 模块化
URL和URI的关系
平衡二叉树(AVL)
[summary of knowledge] summary of notes on using SVN in PHP
Laravel 服务提供者实例教程 —— 创建 Service Provider 测试实例