The factory design pattern is used for object creation and instantiation. A factory method decides which class to instantiate and returns a generic object. There can be multiple subclasses that the factory method creates depending on the arguments passed. The factory pattern example shows a MusicFactory class that uses a switch statement based on a genre enum to return the appropriate subclass such as Rock, Pop, or Reggae.