Design Patterns: Factory
Please see my other Design Pattern articles. Providing flexible object-instantiation. In this example, I’ll illustrate a method by which a SalesAssociate object may be instantiated that is more flexible than the traditional way – using a constructor. Instead I’ll implement a factory design pattern to create the instance. There are two advantages to this approach:…