Alex Rivera | Logout

Where did the concept of Interfaces come from?

Asked 2008-09-19T02:06:21.487
12

In c#, we have interfaces. Where did these come from? They didn't exist in c++.

Edit
Report

3 Answers

5

Interfaces were also a central part of COM, which was a very successful technology for separating interfaces from implementation.

answered 2008-09-19T02:18:47.463
0

In C++ you could have an abstract class with no implementation, and you could inherit multiple classes. Java and C# got rid of multiple inheritance, so in order to have the ability to inherit multiple contracts (not behaviors), they created interfaces. You can only inherit one class in C#, but you can inherit as many interfaces as you want.

An interface is jst a contract. It says which members that an instance must implement. It does this, however, without implementing any default behaviors.

answered 2008-09-19T02:13:47.460
-5

It's just another layer of abstraction. Not really sure where it came from.. I still often hear them called contracts rather than interfaces.

answered 2008-09-19T02:08:59.420

Your Answer