Recently, while learning about Design Patterns, I learnt that the Prototype Pattern is very useful and performance efficient in scenarios where huge number of Object creation is needed.
Prototype Pattern also minimizes the expense of too many object creations by making use of Cloneable interface or Copy Constructor in Prototype Pattern.
But, I would like to know how does cloning or copying an object more efficient than creating a new object. A JVM level explanation would be great.
Is this the only reason Prototype Pattern is made used?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…