In c#, we have interfaces. Where did these come from? They didn't exist in c++.
/ˈɪ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.
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.
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).
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.
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.
Interfaces were also a central part of COM, which was a very successful technology for separating interfaces from implementation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With