Monday, September 11, 2017

INTERFACE

The interface of a book or anything is inside the contents of particular objects. The first part contains the preface, short notes, and a simple description of the book. The second part is acknowledge which tells about the book. The third part is the content that is the subject of the book that is inside the book and is summarized topically and numerically by the content. The last part is the index of the book or also called the glossary which contains brief notification of specific and difficult words.

In computing, an interface is a shared boundary in which information is exchanged between two or more different components of a computer system. Exchange can occur between software, computer hardware, peripheral devices, humans, and a combination of these. Some computer hardware devices, such as touchscreens, can send and receive data through an interface, while others such as a mouse or microphone can only provide an interface to send data to a given system.

Hardware interface
Main article: hardware interface
Hardware interfaces exist in many components, such as various buses, storage devices, other I / O devices, etc. A hardware interface is characterized by mechanical, electrical, and logical signals to interface and protocols for sequencing them (sometimes called signaling). A standard interface, such as SCSI, decouples the design and introduction of computing hardware, such as I / O devices, from the design and introduction of other components of the computing system, allowing users and manufacturers much to implement computing systems. Get flexibility. Hardware interfaces can be parallel with multiple electrical connections that carry parts of data simultaneously, or serial where data is sent one bit at a time. 

Software interface
See also: Application binary interface and application programming interface
A software interface can refer to a wide range of different types of interface at different "levels": an operating system can interface with pieces of hardware. Applications or programs running on the operating system may need to interact through data streams, filters, and pipelines;  And in object oriented programs, objects within the application may need to interact through methods. 

A key principle of design is to prevent access to all resources by default, allowing access only through well-defined entry points, namely interfaces. Software interfaces provide access to computer resources (such as memory, CPU, storage, etc.) of the underlying computer system; Direct access to such resources by software (ie, not through well-designed interfaces) can have major implications - sometimes disastrous for functionality and stability. 

Differences between software components can provide constants, data types, types of processes, exception specifications, and method signatures. Sometimes, public variables are also defined as part of the interface. 

The interface of a software module A is intentionally defined separately from the implementation of that module. The latter contains the actual code of the processes and methods described in the interface, as well as other "private" variables, processes, and more. Another software module B, for example customer A, which interacts with A, is forced to do so. Only through the published interface. A practical advantage of this arrangement is that B should not fail to replace A's implementation by another implementation of the same interface - how A serves the needs internally is not relevant to B, which Interface is only related to specifications. (See also Liskov substitution theory.)

In object-oriented languages
Main article: Protocol (Object-Oriented Programming) and Concept (General Programming)
In some object-oriented languages, especially those without complete multiple inheritance, the term interface is used to define an abstract type that contains no data but defines the behavior as a method signature. A class that contains code and data for all methods corresponding to that interface, and declaring so implements that interface.  Furthermore, even in single-inheritance-languages, one can implement multiple interfaces, and so can be of different types at the same time. 

An interface is thus a type definition; Any object can be exchanged (for example, in a function or method call) from an implemented interface or base-class, instead of specifying the specific class that is to be exchanged. Can be defined as one. This approach means that any class that implements that interface can be used. For example, a dummy implementation can be used to allow development before the final implementation is available. In another case, a mock or mock implementation can be substituted during testing. Such stub implementation is replaced by the actual code later in the development process.Usually a method defined in an interface has no code and thus cannot be called itself; It should be implemented by non-abstract code when applicable. [Citation needed] An interface called "stack" can define two methods: push () and pop (). It can be implemented in different ways, for example, FastStack and GenericStack — the first being faster, working with a fixed-size data structure, and the second using a data structure that can be shaped , But at the cost of some reduced speed.

However interfaces can have many methods in which they cannot have only one or even one. For example, the Java language defines an interface that is readable that has a single read () method; Different implementations are used for different purposes, including Bufferreader, FileReader, InputStreamReader, PipedReader, and StringReader. Marker interfaces such as serializable have no methods and serve to provide run-time information for normal processing using reflection.

Interface for programming
Allows to use interfaces for a programming style called programming for interfaces. The idea behind this approach is to base programming logic on the interfaces of the objects used, rather than on internal implementation details. The programming implementation on the interface reduces dependency on nuances and makes the code more reusable.

To top this idea, the inverse of the control leaves the context to inject the code that will be used to work with the specific implementation of the interface.

No comments:

Post a Comment

Featured Post

Maha Gadhi Mela 2024 December

This year brings Maha Gadhi Mai Mela 2024 December which is very famous around the world . Many people come to visit this Mela from various ...

Latest