Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where did the concept of Interfaces come from?

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

like image 846
therealhoff Avatar asked Sep 19 '08 02:09

therealhoff


People also ask

What does it mean by interfaces?

/ˈɪn·tərˌfeɪs/ the place where two systems come together and have an effect on each other, or a connection between two computers or between a person and a computer: Amphibians live at the interface of land and sea. To simplify software, you improve its interface. interface.

What is the point of interfaces in Java?

In Java, an interface specifies the behavior of a class by providing an abstract type. As one of Java's core concepts, abstraction, polymorphism, and multiple inheritance are supported through this technology. Interfaces are used in Java to achieve abstraction.

What does interface mean in programming?

Interfaces in Object Oriented Programming Languages. An interface is a programming structure/syntax that allows the computer to enforce certain properties on an object (class).

What is the interface Why do we call it to interface why not we can call it a class?

An interface is the source for polymorphism. Interfaces are always implemented whereas classes are always extended. The access specifiers private, public and protected are possible with classes. But interfaces can have only one specifier, public.


2 Answers

Interfaces are pretty old, and have been around for quite a while.

Early (mid to late late 1970's) non-object oriented languages such as Modula and Euclid used constructs called "modules" to specify the interfaces between components. Components would then communicate with each other via explicit importing and exporting modules. Interfaces in C# are object oriented evolutions of that same concept.

Interfaces in C# directly extend from the concept of interfaces in C++ (and Java), where they were used as part of COM for describing object-oriented component interfaces.

EDIT: In doing a small amount of research, the earliest language I could find with an explicit "interface" keyword was Modula-3, a derivitive of Modula created around 1986.

like image 195
Scott Wisniewski Avatar answered Oct 13 '22 05:10

Scott Wisniewski


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

like image 5
17 of 26 Avatar answered Oct 13 '22 04:10

17 of 26