Ray's playground

 

Factory Method(Chapter 4 of Pro Objective-C Design Patterns for iOS)

The abstract Product defines the interface of objects the factory method creates. The ConcreteProduct implements the Product interface. The Creator defines the factory method that returns an object of Product. It may also define a default implementation of the factory method that returns a default ConcreteProduct object. Other operations of the Creator may call the factory method to create a Product object. The ConcreteCreator is a subclass of the Creator. It overrides the factory method to return an instance of ConcreteProduct.

posted on 2012-03-26 15:04  Ray Z  阅读(276)  评论(0编辑  收藏  举报

导航