- Spring 5 Design Patterns
- Dinesh Rajput
- 183字
- 2021-07-08 09:59:33
Prototype design pattern
The Prototype pattern comes under the creational design pattern family of GOF patterns in software development. This pattern is used to create the objects by using a clone method of objects. It is determined by a prototypical instance. In the enterprise application, object creation is costly in terms of creating and initializing the initial properties of objects. If such a type of object is already in your hand, then you go for the prototype pattern; you just copy an existing similar object instead of creating it, which is time-consuming.
This pattern involves implementing a prototype interface, it creates a clone of the current object. This pattern is used when the direct creation of the object is costly. For example, say that an object is to be created after a costly database operation. We can cache the object, returns its clone on the next request, and update the database as and when it is needed, thus reducing database calls.
- 解構(gòu)產(chǎn)品經(jīng)理:互聯(lián)網(wǎng)產(chǎn)品策劃入門寶典
- Docker技術(shù)入門與實戰(zhàn)(第3版)
- 潮流:UI設(shè)計必修課
- Data Analysis with IBM SPSS Statistics
- Easy Web Development with WaveMaker
- Nginx Essentials
- 人人都是網(wǎng)站分析師:從分析師的視角理解網(wǎng)站和解讀數(shù)據(jù)
- Java EE 7 Development with NetBeans 8
- 重學(xué)Java設(shè)計模式
- Mastering KnockoutJS
- Julia高性能科學(xué)計算(第2版)
- Emgu CV Essentials
- MySQL程序員面試筆試寶典
- Kotlin極簡教程
- Keil Cx51 V7.0單片機高級語言編程與μVision2應(yīng)用實踐