Arvind Yadav
Explain the Prototype Design Pattern

Explain the Prototype Design Pattern

By Arvind Yadav in JavaScript on Mar 23 2022
  • Bohdan Stupak
    Jun, 2022 20

    Prototype pattern refers to creating duplicate object while keeping performance in mind. This type of design pattern comes under creational pattern as this pattern provides one of the best ways to create an object.

    This pattern involves implementing a prototype interface which tells to create a clone of the current object. This pattern is used when creation of object directly is costly. For example, an object is to be created after a costly database operation. We can cache the object, returns its clone on next request and update the database as and when needed thus reducing database calls.

    • 1


Most Popular Job Functions


MOST LIKED QUESTIONS