计算接口 [英] Calculate Interface

查看:105
本文介绍了计算接口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们,我想知道如何使用计算界面来使用Gof Factory方法设计模式。我只是想这个用于学习目的。  我认为这是一个简单的开始方式。我想我会设计
计算器用户界面,然后根据用户是否点击加,减,除或乘按钮创建我的对象计算方法。谢谢!
$



Hello Friends, I was wondering how i could use the Gof Factory Method Design Pattern using a Calculate Interface. I am just asking this for learning purposes.  I thought that this would be a simple way to start out. I'm thinking that i would design a calculator user interface and then create my object methods for calculation based on whether the user clicks on an add, subtract, divide, or multiply button. Thanks !


推荐答案

例如

public interface ICalculator { }

public class Program
{
    public ICalculator CreateCalculator() {
        ICalculator result = null;
        // Implement creation.
         return result;
    }
}


这篇关于计算接口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆