0 votes
in Design Patterns by
What is the main advantage of using a prototype design pattern over object creation using a new keyword?

1 Answer

0 votes
by

Prototype design pattern is used for creating duplicate objects based on the prototype of the already existing object using cloning. Doing this has a positive impact on the performance of object creation. Creating objects using the new keyword requires a lot of resources and is a heavyweight process that impacts performance. Hence, the prototype design pattern is more advantageous than the object created using a new keyword.

Related questions

+1 vote
asked Oct 17, 2019 in Design Patterns by Robin
0 votes
asked Jul 23, 2023 in Design Patterns by Robindeniel
...