当前位置:网站首页>[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
边栏推荐
猜你喜欢

Horizontal and vertical centering method and compatibility

Xcode Revoke certificate

水平垂直居中 方法 和兼容

Continuous creation depends on it!

Statistical learning method -- perceptron
![[medical segmentation] attention Unet](/img/f4/cf5b8fe543a19a5554897a09b26e68.png)
[medical segmentation] attention Unet

spark调优(三):持久化减少二次查询

【Android -- 数据存储】使用 SQLite 存储数据

全网“追杀”钟薛高

Have fun | latest progress of "spacecraft program" activities
随机推荐
两类更新丢失及解决办法
torch. Numel action
Cesium (4): the reason why gltf model is very dark after loading
Xcode Revoke certificate
Odoo集成Plausible埋码监控平台
How to query the data of a certain day, a certain month, and a certain year in MySQL
Iptables only allows the specified IP address to access the specified port
How can laravel get the public path
JS中null NaN undefined这三个值有什么区别
JS modularization
PHP实现执行定时任务的几种思路详解
ThinkPHP URL 路由简介
AutoLISP series (1): function function 1
删除 console 语句引发的惨案
[designmode] facade patterns
如何快速检查钢网开口面积比是否符合 IPC7525
Laravel5.1 路由 -路由分组
MySQL中, 如何查询某一天, 某一月, 某一年的数据
Mysql database basic operation DQL basic query
深度监听 数组深度监听 watch