FactoryModel
2017-04-13 09:26:29 2 举报
工厂模式
作者其他创作
大纲/内容
Operation
#double num1#double num2
+ virtual double getResult()
OperationAdd
+override double getResult(){ return num1+num2;}
Operation createOperation();
AddFactory
Operation createOperation(){ return new OperationAdd()}
SubFactory
Operation createOperation(){ return new OperationSub()}
OperationSub
+override double getResult(){ return num1-num2;}
0 条评论
下一页
为你推荐
查看更多
抱歉,暂无相关内容