There are some different variations of the factory design patterns. In all cases though, the purpose is generally the same—hide creation complexity. In the following subsections, we will briefly mention two of the other factory design patterns—static factory and simple factory.
Other factory design patterns
The static factory
The static factory could be represented as a static method, which is a part of the base class. It is called to create concrete instances, which extend the base class. One of the biggest drawbacks here, however, is that if another extension of the base class is added, the base class (because of the static method) also has to be edited. Let's show a simple example from the world of animals...