5. Prototypes Design Pattern
Prototypes Design Pattern - Prototype pattern is one of the Creational Design patterns, so it provides a mechanism of object creation. However, Prototype pattern is used when the Object creation is a costly affair. Also, it requires a lot of time and resources and if you have a similar object already existing. Therefore, this pattern provides a mechanism to copy the original object to a new object and then modify it according to our needs. Moreover, this pattern uses java cloning to copy the object. - The concept is to copy an existing object rather than creating a new instance from scratch.bcoz creating new object may be constly. - This approach saves costly resource and time, especially when object creation is a heavy process. - Imagine you have an object, let's call it "Prototype". This object is quite complex, and you want to make copies of it, but creating each copy from scratch would be inefficient and time-consuming. So, instead of creating copies by re-creatin...