Intent:
Specifies the kinds of objects to create using a prototypical instance and creates
new objects by copying this prototype.
Description:
The Prototype pattern allows an object to create customized objects without knowing
their exact class or the details of how to create them. The Prototype pattern gives
prototypical objects to an object and then initiates the creation of objects. The
creation-initiating object then creates objects by asking the prototypical objects to
make copies of them.
Benefits:
• Hides the concrete product classes from the client.
• Adding and removing products at runtime.
• Specifying new objects by varying values.
• Specifying new objects by varying structure.
• Reduced subclassing.
No comments:
Post a Comment