Where did the concept of Interfaces come from?

后端 未结 18 2209
有刺的猬
有刺的猬 2021-01-11 18:45

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

18条回答
  •  南方客
    南方客 (楼主)
    2021-01-11 19:14

    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.

提交回复
热议问题