Creational patterns hide many details from programmers. For example, the Java core API uses the
Factory Method pattern to create
This specific Factory Method is
openConnection() in the
Application Programming Interface: The API specifies the method used by a programmer when writing an application to
access the behavior and state of classes and objects.
This is an excellent use of a creational design pattern to enhance flexibility about what gets created.
Creational design patterns can also be used
- to increase the flexibility with respect to who creates an object,
- how the client creates the object, and
- when the object is created.
A class that contains one or more abstract methods, and therefore can never be instantiated.
Abstract classes are defined so that other classes can extend them and make them concrete by implementing the abstract methods.