.net接口的项目类型 [英] project type of .net interfaces

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

问题描述

亲爱的朋友,

我计划在.net项目中使用接口.

我想在现有解决方案中添加一个新项目"MyInterfaces". "MyInterfaces"旨在包含解决方案的所有必要接口.
但是我对项目类型有些困惑.我应该选择哪种类型的项目来启动"MyInterfaces"?类库,还是其他?

然后,我将在项目中添加哪种类型的项目以声明接口?接口还是类?

请为我提供一点帮助.

问候
SKPaul

Dear friends,

I am planning to use interfaces in my .net project.

I would like to add a new project "MyInterfaces" in my existing solution. "MyInterfaces" intends to contain all the necessary interfaces of the solution.
But i am somewhat confused about the project type. What type of project should i choose to start "MyInterfaces"? Class Library, or something else?

Then, what type of item would i add into that project to declare an interface? Interface or class?

Please obliged my by providing a tiny help.

Regards
SKPaul

推荐答案

如果您的代码不包含用户界面元素(而Interfaces通常不包含),则可以使用类库.

如果您想要一个接口,请使用它!它提供了比Class类更好的模板-但没有太大区别!
If your code contains not user interface elements (and Interfaces generally don''t), then Class Library is the one to go for.

If you want an Interface, use that! It provides a better template than Class - but there isn''t a lot of difference!


错误的问题.接口可以在任何项目中使用,并且通常应该使用.这几乎与询问在哪种类型的项目中应使用operator =.

—SA
Incorrect question. Interfaces can be used in any projects and most typically should be. This is almost the same thing as one would ask "in what type of project should I use operator =".

—SA


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

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