The policy of Simple Factory is reformed, and applied to produce command objects, which eliminates the limitations of past Simple Factory and makes up the defect of Factory Method.
改进了简单工厂模式的实现策略,克服了原来简单工厂模式的局限性,同时弥补了工厂方法模式的不足。
Our roles in the factory were simple: Place cakes on a moving belt. Attach icing ears. Apply icing eyes and nose. Remove bunny from the belt.
我们在工厂的工作很简单:将蛋糕放在传送带上,贴上糖霜耳朵,涂上糖霜的眼睛和鼻子,然后从传送带上取下兔子蛋糕。
Sounds simple -- but this is where the specific context factory that you chose could start to affect matters.
听起来简单 ―― 但是这里您所选择的特定上下文工厂就要产生影响了。
应用推荐