A Simple Factory encapsulates the conditional logic used to create a product. Figure 6-1 shows the class diagram.
Figure 6-1. Simple Factory class diagram
A Simple Factory has the following parts:
Its benefits are as follows:
It also has this drawback:
Simple Factory isn't a design pattern, but it needs to be included in this chapter because the Factory Method design pattern uses what resembles a simple factory. ...