• Home
  • Recent Q&A
  • Java
  • Cloud
  • JavaScript
  • Python
  • SQL
  • PHP
  • HTML
  • C++
  • Data Science
  • DBMS
  • Devops
  • Hadoop
  • Machine Learning
in Design Patterns by
What is the benefit of using prototype design pattern over creating an instance using the new keyword?

1 Answer

0 votes
Sometimes, object creation is heavyweight and requires a lot of resources, creating a new instance will impact the performance. In such cases, a prototype design pattern is used which refers to creating duplicate objects. In prototype design pattern, if a similar object is already present then cloning is done keeping performance in mind.

Related questions

0 votes
asked Jan 22 in APIGEE - API Services by Robindeniel
0 votes
asked Oct 17, 2019 in Design Patterns by Robin