- 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.
- Python程序設(shè)計(jì)教程(第2版)
- Mobile Application Development:JavaScript Frameworks
- Node.js Design Patterns
- Spring Boot開發(fā)與測(cè)試實(shí)戰(zhàn)
- DevOps with Kubernetes
- Magento 2 Development Cookbook
- JavaScript入門經(jīng)典
- 學(xué)習(xí)正則表達(dá)式
- RealSenseTM互動(dòng)開發(fā)實(shí)戰(zhàn)
- Mastering Git
- Scala for Machine Learning(Second Edition)
- R語(yǔ)言數(shù)據(jù)可視化:科技圖表繪制
- Android Studio Cookbook
- Vue.js光速入門及企業(yè)項(xiàng)目開發(fā)實(shí)戰(zhàn)
- Beginning PHP