think of Simple Factory as a one shot deal, while with Factory Method your are creating a framework that let's the subclasses decide which implementation will be used. Simple Factory gives you a way to encapsulate object creation, but doesn't give you the flexibility of the Factory Method because there is no way to vary the products your're creating.
posted on 2005-08-11 17:16
Dave 阅读(85)
评论(0) 编辑 收藏