Factory Pattern

Intent
Define an interface for creating an object. But let subclasses decide which class to instantiate. Factory method lets a class defer instantiation to subclasses.

Abstract Factory Pattern

Intent
Provide an interface for creating families of related or dependent objects without specifying their concrete classes.

你可能感兴趣的:(Factory Pattern)