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 閱讀(86)
評(píng)論(0) 編輯 收藏