首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

Factory Method Design Pattern工场方法模式

2012-10-10 
Factory Method Design Pattern工厂方法模式?? }}运行结果:Motorola producedNokia produced?A?factory me

Factory Method Design Pattern工厂方法模式

Factory Method Design Pattern工场方法模式

?? }

}

运行结果:

Motorola produced
Nokia produced

?

A?factory method can?be defined as a method in a class that:
(1)Selects an appropriate class from a class hierarchy based on the application context and other influencing factors
(2)Instantiates the selected class and returns it as an instance of the parent class type

热点排行