| Matt Can Code |
|
|||
|
公告
日历
统计
导航 |
Factory Design Pattern(FDP) is comparatively small in granularity than either Simple Factory or Abstract Factory, one kind of factory produce one and only one kind of production. The abstract of FDP is to let the subtype of factory decide the particular type of its production. Here is a analogue in real life that I have conceived in my head for so long that can describe this Design Pattern. a Mother can produce a baby, this is a common sense, so I am analogizing mother as a factory(by no means an insult to a mother), a specified kind of mother can produce a specified kind of baby, a more specified kind of mother can produce a more specified kind of baby. In the early blog issue 典型的组合模式和迭代器, iterator is also a product which is produced by Factories like ArrayList, SortedList, Collection and consumed by the client who has the access to the Factory and the product, and the product in this special case encapsulated the data structure of the Factory, pretty much a hybrid of Bridge and Factory.Do you agree? 程序员问答社区,解决您的IT难题
|
![]() |
|
| Copyright © Matt Yeung | Powered by: 博客园 模板提供:沪江博客 |