您的位置:首页 > 其它

【设计模式】【工厂方法根据type参数升级为抽象工厂】

2013-01-16 18:11 323 查看
/**
* Description:
* <br/>网站: <a href="http://www.crazyit.org">疯狂Java联盟</a>
* <br/>Copyright (C), 2001-2012, Yeeku.H.Lee
* <br/>This program is protected by copyright laws.
* <br/>Program Name:
* <br/>Date:
* @author  Yeeku.H.Lee kongyeeku@163.com
* @version  1.0
*/
public class OutputFactoryFactory
{
//仅定义一个方法用于返回输出设备。
public static OutputFactory getOutputFactory(
String type)
{
if (type.equalsIgnoreCase("better"))
{
return new BetterPrinterFactory();
}
else
{
return new PrinterFactory();
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: