All Topics  
Interface (computer science)

 

   Email Print
   Bookmark   Link






 

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
Polymorphism in object-oriented programming

In simple terms, polymorphism is the ability of one type, A, to appear as and be used like another type, B. In strongly typed languages, this usually means that type A somehow derives from type B, or type A implements an interface that represents type B....
 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.






Discussion
Ask a question about 'Interface (computer science)'
Start a new discussion about 'Interface (computer science)'
Answer questions from other users
Full Discussion Forum



Encyclopedia


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
Polymorphism in object-oriented programming

In simple terms, polymorphism is the ability of one type, A, to appear as and be used like another type, B. In strongly typed languages, this usually means that type A somehow derives from type B, or type A implements an interface that represents type B....
 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
Indirection

In computer programming, indirection is the ability to reference something using a name, reference, or container instead of the value itself. The most common form of indirection is the act of manipulating a value through its memory address....
, some additional overhead is incurred versus direct communication.

The interface between a human and a computer is called a user interface
User interface

The user interface is the aggregate of means by which people—the User s—Interaction with the system—a particular machine, device, computer program or other complex tools....
. Interfaces between hardware components are physical interfaces. This article deals with software interfaces, which exist between separate software components 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.

The types of access that interfaces provide between software components can include: constants, data type
Data type

A data type in programming languages is an attribute of a data which tells the computer something about the kind of data it is. This involves setting constraints on the datum, such as what values it can take and what operations may be performed upon it....
s, types of procedure
Procedure

A procedure is a specified series of actions, acts or operations which have to be executed in the same manner in order to always obtain the same result under the same circumstances ....
s, exception
Exception handling

Exception handling is a programming language construct or computer hardware mechanism designed to handle the occurrence of exceptions - special conditions that change the normal flow of execution....
 specifications and method signature
Method signature

In computer programming, especially object-oriented programming, a Method is commonly identified by its unique method signature. This usually includes the method name, the number and type of its parameters, and its return type....
s. In some instances, it may be useful to define variable
Variable

A variable is a symbol that stands for a value that may vary; the term usually occurs in opposition to constant, which is a symbol for a non-varying value, i.e....
s as part of the interface. It often also specifies the functionality of those procedures and methods, either by comment
Comment (computer programming)

In computer programming, a comment is a programming language construct used to embed programmer-readable annotations in the source code of a computer program....
s or (in some experimental languages) by formal logical assertions.

The interface of a software module 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 (which can be referred to as a client to A) that interacts with is forced to do so only through the interface. One practical advantage of this arrangement is that replacing the implementation of by another one that meets the same specifications of the interface should not cause to fail—as long as its use of complies with the specifications of the interface (see also Liskov substitution principle
Liskov substitution principle

In object-oriented programming, the Liskov substitution principle is a particular definition of subtype that was introduced by Barbara Liskov in a 1987 conference keynote address entitled Data abstraction and hierarchy...
).

See also

  • Abstraction inversion
    Abstraction inversion

    In computer programming, abstraction inversion is an anti-pattern arising when users of a construct need functions implemented within it but not exposed by its interface....
  • Application binary interface
    Application binary interface

    In computer software, an application binary interface describes the low-level interface between an application program and the operating system or an other application....
  • Application programming interface
    Application programming interface

    An application programming interface is a set of subroutine, data structures, class and/or Protocol provided by library and/or operating system Service s in order to support the building of applications....
  • Computer bus
    Computer bus

    In computer architecture, a bus is a subsystem that transfers data between computer components inside a computer or between computers. Each bus defines its set of connectors to physically plug devices, cards or cables together....
  • Implementation inheritance
    Implementation inheritance

    In programming, Implementation inheritance is the inheritance of the full functionality of a Class , as opposed to the inheritance of an interface , which simply defines the methods that must be present....
  • Inheritance semantics
    Inheritance semantics

    Inheritance semantics is an important concept in object-oriented programming....
  • Interface (UML)
  • Modularity (programming)
    Modularity (programming)

    Modular programming is a software design technique that increases the extent to which software is composed from separate parts, called modules. Conceptually, modules represent a separation of concerns, and improve maintainability by enforcing logical boundaries between components....
  • Network interface
    Network interface

    In telecommunications and computer networking, a network interface is one of:#The point of interconnection between a User computer terminal and a private or public computer network....
  • Software componentry
  • User interface
    User interface

    The user interface is the aggregate of means by which people—the User s—Interaction with the system—a particular machine, device, computer program or other complex tools....
  • Virtual inheritance
    Virtual inheritance

    In the C++ programming language, virtual inheritance is a kind of Inheritance that solves some of the problems caused by multiple inheritance by clarifying ambiguity over which ancestor class members to use....