为什么界面在oop中很重要 [英] why interfaces is important in oop

查看:109
本文介绍了为什么界面在oop中很重要的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好狐狸怎么样?
i总是问我什么时候以及为什么我需要实现接口。

i差不多2年编程我从来没有觉得我需要接口在我的模式

可以请一些人解释一下它的重要和好处以及没有它可以处理的实际案例,或者至少任何参考文献都可以提供帮助

thanx

hi foxes how are you
i always ask when and why i need to implement interfaces.
i am almost 2 years programming and i never felt like i need interface in my pattern
can some one please explain the important and benefits of it and practical cases that cant be handle without it or at least any references can help in that point
thanx

推荐答案

Code Project上的简单搜索可以找到这些以及更多文章:



为什么我们需要接口? [ ^ ]



< a href =http://www.codeproject.com/Tips/780327/Interfaces-and-its-Importance>接口及其重要性 [ ^ ]



揭开C#界面的神秘面纱 [ ^ ]
A simple search here on Code Project finds these and many more articles:

Why do we need Interfaces?[^]

Interfaces and its Importance[^]

Demystifying interfaces in C#[^]


请参阅 http: //msdn.microsoft.com/en-gb/library/87d83y5b.aspx [ ^ ]。接口基本上是契约,如果实现接口,则必须提供合同中列出的所有元素(方法和属性)。
See http://msdn.microsoft.com/en-gb/library/87d83y5b.aspx[^]. An interface is basically a contract, if you implement the interface you must provide all the elements (methods and properties) listed in the contract.


这篇关于为什么界面在oop中很重要的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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