dimanche 14 août 2016

Prototype design pattern

When exactly do we go for the prototype design pattern ? What I understood from various resources is to use the pattern when we find instantiating a class using new Operator Or when we want the runtime initialization os object. So How exaclty we could define an instantiation of class using new operator to be expensive? when the class defination coumtains too many fields and that too seldom going to change in future???

Is instantiating a chess board with all players set up for every new game will be too costlier to be instantiated using new operator?

Can someone through some light on same?

Aucun commentaire:

Enregistrer un commentaire