在c#上使用接口类有什么问题或缺点? [英] what is the problems or disadvantages of using interface class on c# ?

查看:130
本文介绍了在c#上使用接口类有什么问题或缺点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在visual studio 2015上使用c#我阅读并使用接口类更多 

I work on c# on visual studio 2015 i read and using interface class more 

public interface dataInterface
{
//prototype function here
}

它在解决csharp上的多重继承方面发挥着重要作用

and it have big role in solving multi inheritance on csharp

以便 

使用界面有什么问题或缺点?

What is the problems or disadvantages of using interface ?




推荐答案


我在visual studio 2015上使用c#我阅读并使用了更多接口类

I work on c# on visual studio 2015 i read and using interface class more 

public interface dataInterface
{
//prototype function here
}

它在解决csharp上的多重继承方面发挥着重要作用

and it have big role in solving multi inheritance on csharp

以便 

使用界面有什么问题或缺点?

What is the problems or disadvantages of using interface ?




使用我所知道的界面没有任何缺点,除非开发人员不理解purpo se使用接口以及如何有效地使用接口,这是两个对象(调用和被调用对象)之间的契约。

There is no disadvantage of using an interface that I know about, unless the developer doesn't understand the purpose of using an interface and how to use the interfaces effectively, which is a contract between two objects, the calling and called object.

该接口公开调用对象可以使用的被调用对象实现的公共属性和方法。 

The interface exposes the public properties and methods the called object implements that the calling object can use. 

使用接口促进领域驱动设计和单元测试,控制反转,依赖注入和松散耦合。

Using an interface promotes Domain Driven Design and unit testing, Inversion of Control, Dependency Injection and loose coupling.


这篇关于在c#上使用接口类有什么问题或缺点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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