lundi 23 janvier 2017

Prototype design pattern to be used when new is costly, but we do new in clone

I have been learning about the various design patterns. In particular for the Prototype design pattern the use case states that it should be used when calling new is costly. And hence use clone. But within the clone() function we ultimately end up using the new operator. Can someone please explain me what is the significance of the use case for this pattern

Aucun commentaire:

Enregistrer un commentaire