标签:工厂 nbsp dos 不同的 不同 something 学习 场景 简单工厂模式
简单工厂模式
应用场景:根据xyz三种类型,有不同的行为。
if(type == x)
dosomethingX();
else (type == y)
dosomethingY();
else (type == z)
dosomethingZ();
可以考虑工厂模式。
标签:工厂 nbsp dos 不同的 不同 something 学习 场景 简单工厂模式
原文地址:http://www.cnblogs.com/guochunyi/p/6131087.html