- Interface (computer science)
Interface generally refers to an abstraction that an entity provides of itself to the outside. This separates the methods of external communication from internal operation, and allows it to be internally modified without affecting the way outside entities interact with it, as well as provide multiple abstractions of itself. It may also provide a means of translation between entities which do not speak the same language, such as between a human and a computer. Because interfaces are a form of
indirection , some additional overhead is incurred versus direct communication.The interface between a human and a computer is called a
user interface . Interfaces between hardware components arephysical interface s. This article deals with "software interfaces", which exist between separatesoftware component s and provide a programmatic mechanism by which these components can communicate.Interfaces in practice
A piece of 'software' provides access to computer resources (such as memory, CPU, storage, etc.) by its underlying computer system; the availability of these resources to other software can have major ramifications -- sometimes disastrous ones -- for its functionality and stability. A key principle of design is to prohibit access to all resources by default, allowing access only through well-defined entry points, i.e.
interfaces .Fact|date=January 2008The types of access that interfaces provide between software components can include: constants,
data type s, types ofprocedure s, exception specifications andmethod signature s. In some instances, it may be useful to definevariable s as part of the interface. It often also specifies the functionality of those procedures and methods, either by comments or (in some experimental languages) by formal logical assertions.The interface of a software module A is deliberately kept separate 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 B (which can be referred to as a "client" to "A") that interacts with A is forced to do so "only" through the interface. One practical advantage of this arrangement is that replacing the implementation of A by another one that meets the same specifications of the interface should not cause B to fail — as long as its use of A complies with the specifications of the interface (See also
Liskov substitution principle ).See also
*
Abstraction inversion
*Application binary interface
*Application programming interface
*Computer bus
*Implementation inheritance
*Inheritance semantics
*Interface (UML)
*Modularity (programming)
*Network interface
*Software componentry
*User interface
*Virtual inheritance
Wikimedia Foundation. 2010.