FACTORY and PROTOTYPE

Factory

Defines an interface for creating objects. Allows subclasses to decide which concrete class to instantiate. The Factory is a Creator. It is usually abstract, although the create() method can provide a default implementation.

It is useful when