Interface (computing): Difference between revisions

Content deleted Content added
m link to Microsoft .NET
Dysprosia (talk | contribs)
an interface itself is not a software component - it is a specification - +other more generalizing features
Line 1:
In [[computer science]], an '''interface''' is a specification that exists between software componentcomponents that specifies a selected means of interaction, by means of properties of other software modules, used forwhich [[abstraction|abstract]] and [[encapsulation|encapsulate]] oftheir data.
 
An interface normally defines athe setmeans of interaction between software components - this includes [[constant]]s, [[data type]]s, [[variables]], [[procedure]]s, and [[method signature]]s. In some instances, it may be useful to define [[variable]]s as part of the interface. It often specifies also specifies the functionality of those procedures and methods, either by [[comment]]s or (in some experimental languages) by formal logical assertions.
 
The interface of a software module <math>A</math> is deliberately kept seperate from the ''implementation'' of that module. The latter contains the actual code of the procedures and methods described in the interface, as well as other "private" variables, procedures, etc.. Any other software module <math>B</math> (which can be referred to as a ''client'' to ''A'') that interacts with <math>A</math> is forced to do so ''only'' through the interface. One practical advantage of this arrangment is that replacing the implementation of <math>A</math> by another one that meets the same specifications of the interface should not cause <math>B</math> to fail &mdash; as long as itsthe useimplementation of <math>A</math> complies with the specifications of the interface.
 
The concept of interface is the cornerstone of [[modular programming]], a forerunner and a standard ingredient of [[object-oriented programming]]. Interfaces were historically derived from the [[header file]]s of the [[C programming language]] by restricting their syntactic context and contents, and making them a part of the language semantics (as opposed to a mere preprocessor feature).
 
Certain programming languages have different methodologies for allowing the construction of interfaces. In general, any programming language can implement an interface, but the following [[programming language]]s provide specific interface ''constructs'' in the programming language of some kind:
* [[Mesa programming language|Mesa]] ([[Xerox PARC]], ca. [[1978]])
* [[Modula programming language|Modula]] ([[Niklaus Wirth]], [[ETH Zurich]], [[1980s]])