The creational patterns aim to separate a system from how its objects are created, composed, and represented. Creational patterns encapsulate the knowledge about which classes a system uses, but they hide the details of how the instances of these classes are created and put together.
The Prototype pattern ensures that when copies of complex objects are made, they are true copies.
The Factory Method pattern is a means of creating objects without knowing the exact subclass being used.
The Singleton pattern ensures that only one of a class can be built and that all users are directed to it.
1. Prototype pattern
Given a key, the program creates an object of the required type, not by instantiation,
but by copying a clean instance of the class.
The Prototype pattern ensures that when copies of complex objects are made, they are true copies.
The Factory Method pattern is a means of creating objects without knowing the exact subclass being used.
The Singleton pattern ensures that only one of a class can be built and that all users are directed to it.
1. Prototype pattern
Given a key, the program creates an object of the required type, not by instantiation,
but by copying a clean instance of the class.
No comments:
Post a Comment