DEV Community

Discussion on: The Prototype Design Pattern C# .net core

Collapse
 
diagonallay profile image
DiagonAllay

Sorry for misunderstand... I wonder what is the diffrent between multiple copies that changing in one instance of them will affect the other... While you just can use singleton instead

Thread Thread
 
gary_woodfine profile image
Gary Woodfine

prototype pattern lets you create new instances of a class by duplicating an already existing instance. You create new instance of class by copying an existing class.

Singleton pattern ensures there is only 1 of class. You do not create new instances of a singleton class, you only have 1 instance