Prototype pattern refers to create replacement object while keeping presentation in brain. This type of design pattern comes under creational pattern as this example provides one of the best traditions to create an entity.
This pattern involves implementing a prototype line which tells to produce a clone of the current object. This pattern is used when design of object directly is valuable. For instance, an object is to be created after a costly database operation. We can cache the object, returns its clone on next call and update the database as and when needed thus dipping database calls.
We're going to create a summary class Shape and real classes extending the Shape class. A class Shape Cache is defined as a next step which supplies shape objects in a Hash table and income their clone when request.
PrototypPatternDemo, our demo category will use Shape Cache class to get a form entity.
Make an abstract class implement Closable line.
Create concrete classes extending the beyond class.
Generate a class to get real classes from folder and layup them in a Hash chart.
PrototypePatternDemo uses Shape Cache class to obtain clone of shapes store in a Hash table.
Design Patterns Related Interview Questions
|Java Script Interview Questions||AJAX Interview Questions|
|Graphic Design Interview Questions||Adobe Indesign Interview Questions|
|Java-Multithreading Interview Questions||Database Design Interview Questions|
|Compiler Design Interview Questions||CSS Advanced Interview Questions|
|Java Design Patterns Interview Questions||Hardware design Interview Questions|
|Material Design Lite Interview Questions||Object Oriented Analysis and Design Interview Questions|
|Standard Template Library (STL) Interview Questions|
Design Patterns Tutorial
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.