Interface (computing)

In computing, an interface is a shared boundary across which two or more separate components of a computer system exchange information. The exchange can be between software, computer hardware, peripheral devices, humans, and combinations of these.[1] Some computer hardware devices, such as a touchscreen, can both send and receive data through the interface, while others such as a mouse or microphone may only provide an interface to send data to a given system.[2]

Hardware interfaces

Hardware interfaces of a laptop computer: Ethernet network socket (center), to the left a part of the VGA port, to the right (upper) a display port socket, to the right (lower) a USB-A socket.

Hardware interfaces exist in many components, such as the various buses, storage devices, other I/O devices, etc. A hardware interface is described by the mechanical, electrical, and logical signals at the interface and the protocol for sequencing them (sometimes called signaling).[3] 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 a computing system, thereby allowing users and manufacturers great flexibility in the implementation of computing systems.[3] Hardware interfaces can be parallel with several electrical connections carrying parts of the data simultaneously or serial where data are sent one bit at a time.[4]

Software interfaces

A software interface may refer to a wide range of different types of interfaces at different "levels". For example, an operating system may interface with pieces of hardware. Applications or programs running on the operating system may need to interact via data streams, filters, and pipelines.[5] In object oriented programs, objects within an application may need to interact via methods.[6]

In practice

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.[7] Software interfaces provide access to computer resources (such as memory, CPU, storage, etc.) of the underlying computer system; direct access (i.e., not through well-designed interfaces) to such resources by software can have major ramifications—sometimes disastrous ones—for functionality and stability.[citation needed]

Interfaces between software components can provide constants, data types, types of procedures, exception specifications, and method signatures. Sometimes, public variables are also defined as part of an interface.[8]

The interface of a software module A is deliberately defined separately 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. Another software module B, for example the client to A, that interacts with A is forced to do so only through the published interface. One practical advantage of this arrangement is that replacing the implementation of A with another implementation of the same interface should not cause B to fail—how A internally meets the requirements of the interface is not relevant to B, which is only concerned with the specifications of the interface. (See also Liskov substitution principle.)[citation needed]

In object-oriented languages

In some object-oriented languages, especially those without full multiple inheritance, the term interface is used to define an abstract type that acts as an abstraction of a class. It contains no data, but defines behaviours as method signatures. A class having code and data for all the methods corresponding to that interface and declaring so is said to implement that interface.[9] Furthermore, even in single-inheritance-languages, one can implement multiple interfaces, and hence can be of different types at the same time.[10]

An interface is thus a type definition; anywhere an object can be exchanged (for example, in a function or method call) the type of the object to be exchanged can be defined in terms of one of its implemented interfaces or base-classes rather than specifying the specific class. This approach means that any class that implements that interface can be used.[citation needed] For example, a dummy implementation may be used to allow development to progress before the final implementation is available. In another case, a fake or mock implementation may be substituted during testing. Such stub implementations are replaced by real code later in the development process.

Usually, a method defined in an interface contains no code and thus cannot itself be called; it must be implemented by non-abstract code to be run when it is invoked.[citation needed] An interface called "Stack" might define two methods: push() and pop(). It can be implemented in different ways, for example, FastStack and GenericStack—the first being fast, working with a data structure of fixed size, and the second using a data structure that can be resized, but at the cost of somewhat lower speed.

Though interfaces can contain many methods, they may contain only one or even none at all. For example, the Java language defines the interface Readable that has the single read() method; various implementations are used for different purposes, including BufferedReader, FileReader, InputStreamReader, PipedReader, and StringReader. Marker interfaces like Serializable contain no methods at all and serve to provide run-time information to generic processing using Reflection.[11]

Programming to the interface

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

Pushing this idea to the extreme, inversion of control leaves the context to inject the code with the specific implementations of the interface that will be used to perform the work.

User interfaces

A user interface is a point of interaction between a computer and humans; it includes any number of modalities of interaction (such as graphics, sound, position, movement, etc.) where data is transferred between the user and the computer system.

See also

References

  1. ^ Hookway, B. (2014). "Chapter 1: The Subject of the Interface". Interface. MIT Press. pp. 1–58. ISBN 9780262525503.
  2. ^ IEEE 100 - The Authoritative Dictionary Of IEEE Standards Terms. NYC, NY, USA: IEEE Press. 2000. pp. 574–575. ISBN 9780738126012.
  3. ^ a b Blaauw, Gerritt A.; Brooks, Jr., Frederick P. (1997), "Chapter 8.6, Device Interfaces", Computer Architecture-Concepts and Evolution, Addison-Wesley, pp. 489–493, ISBN 0-201-10557-8 See also: Patterson, David A.; Hennessey, John L. (2005), "Chapter 8.5, Interfacing I/O Devices to the Processor, Memory and Operating System", Computer Organization and Design - The Hardware/Software Interface, Third Edition, Morgan Kaufmann, pp. 588–596, ISBN 1-55860-604-1
  4. ^ Govindarajalu, B. (2008). "3.15 Peripheral Interfaces and Controllers - OG". IBM PC And Clones: Hardware, Troubleshooting And Maintenance. Tata McGraw-Hill Publishing Co. Ltd. pp. 142–144. ISBN 9780070483118. Retrieved 15 June 2018.
  5. ^ Buyya, R. (2013). Mastering Cloud Computing. Tata McGraw-Hill Education. p. 2.13. ISBN 9781259029950.
  6. ^ Poo, D.; Kiong, D.; Ashok, S. (2008). "Chapter 2: Object, Class, Message and Method". Object-Oriented Programming and Java. Springer-Verlag. pp. 7–15. ISBN 9781846289637.
  7. ^ Bill Venners (2005-06-06). "Leading-Edge Java: Design Principles from Design Patterns: Program to an interface, not an implementation - A Conversation with Erich Gamma, Part III". artima developer. Archived from the original on 2011-08-05. Retrieved 2011-08-03. Once you depend on interfaces only, you're decoupled from the implementation. That means the implementation can vary, and that is a healthy dependency relationship. For example, for testing purposes you can replace a heavy database implementation with a lighter-weight mock implementation. Fortunately, with today's refactoring support you no longer have to come up with an interface up front. You can distill an interface from a concrete class once you have the full insights into a problem. The intended interface is just one 'extract interface' refactoring away. ...
  8. ^ Patterson, D.A.; Hennessy, J.L. (7 August 2004). Computer Organization and Design: The Hardware/Software Interface (3rd ed.). Elsevier. p. 656. ISBN 9780080502571.
  9. ^ "What Is an Interface". The Java Tutorials. Oracle. Archived from the original on 2012-04-12. Retrieved 2012-05-01.
  10. ^ "Interfaces". The Java Tutorials. Oracle. Archived from the original on 2012-05-26. Retrieved 2012-05-01.
  11. ^ "Performance improvement techniques in Serialization". Precise Java. Archived from the original on 2011-08-24. Retrieved 2011-08-04. We will talk initially about Serializable interface. This is a marker interface and does not have any methods.
  12. ^ Gamma; Helm; Johnson; Vlissides (1995). Design Patterns: Elements of Reusable Object-Oriented Software. Addison Wesley. pp. 17–18. ISBN 9780201633610.

Read other articles:

Danel, ayah dari Aqhat, adalah seorang pahlawan dalam kebudayaan yang muncul pada teks tidak lengkap dalam bahasa Ugarit dari abad ke-14 SM[1] di Ugarit (Ras Shamra), Suriah, di mana nama tersebut diberikan DN'IL, El adalah hakim.[2] Teks Danel Prasasti atau lauh yang memuat bagian dari wiracarita Danel (Musée du Louvre) Teks dalam Corpus Tablettes Alphabétiques [CTA] 17-19 sering disebut sebagai Wiracarita Aqhat. Danel digambarkan sebagai menghakimi kasus seorang janda, men...

 

 

Daftar raja Epiros di bawah ini meliputi semua[1] raja dan ratu, bersama dengan pangeran dan putri sampai perwakilan terakhir dinasti Aeacid dimana demokrasi didirikan. Pada 168 SM, Epiros menjadi provinsi Romawi Epirus Vetus. Tanggal di dalam kurung menandakan periode kekuasaan jika diketahui. Tribes of Epirus in antiquity Admetus (sebelum 470 – 430 SM) Tharrhypas (430 – 392 SM) Alcetas I (390 – 370 SM) Neoptolemus I (370 – 357 SM) Arybbas (373 SM – 343 SM) Alexander I (342...

 

 

Strada statale 128 Centrale SardaLocalizzazioneStato Italia Regioni Sardegna ProvinceSud Sardegna Oristano Nuoro DatiClassificazioneStrada statale InizioSS 131 presso Monastir FineSS 129 presso stazione di Oniferi Lunghezza164,494[1] km Provvedimento di istituzioneLegge 17 maggio 1928, n. 1094 GestoreANAS Manuale La strada statale 128 Centrale Sarda (SS 128) è un'importante strada statale italiana. È la più rapida e antica via di collegamento del cuore della Sar...

1919 1928 Élections législatives françaises de 1924 581 députés à la Chambre des députés 11 et 25 mai 1924 Type d’élection Élections législatives Corps électoral et résultats Inscrits 11 187 745 Votants 9 026 837   80,69 %  10,5 FR – Auguste Isaac Voix 3 190 831 35,35 %   13 Députés élus 116  67 SFIO – Léon Blum Voix 1 814 000 20,10 %   1 Députés&#...

 

 

Flight Check Squadron飛行点検隊Flight Check Squadron U-125(2017)ActiveOctober 1, 1958CountryJapanAllegianceAir Support CommandBranchJapan Air Self-Defense ForceGarrison/HQIruma Air BaseAircraft flownYS-11FC, U-125Military unit Flight Check Squadron (飛行点検隊, hikoutenkentai) is a unit of the Japan Air Self-Defense Force based at Iruma Air Base in Saitama Prefecture north of Tokyo. Under the authority of Air Support Command,[1] it operates YS-11FC and U-125 aircraft.[2&...

 

 

TeleZüriCaractéristiquesCréation 1994Propriétaire CH MediaLangue Suisse-allemandPays SuisseStatut locale privéeSiège social TeleZüri Heinrichstrasse 267 Case Postale 8031 Zurich Tél. : 044 447 24 24 Fax : 044 447 24 25Site web www.telezueri.chDiffusionAnalogique NonNumérique NonSatellite NonCâble Réseau câblé de CablecomIPTV Swisscom TV dans toute la suissemodifier - modifier le code - modifier Wikidata TeleZüri est une chaîne de télévision locale suisse. Ses studio...

Disambiguazione – Se stai cercando la squadra di calcio croata, vedi HNK Gorica. Questa voce sull'argomento società calcistiche slovene è solo un abbozzo. Contribuisci a migliorarla secondo le convenzioni di Wikipedia. ND GoricaCalcio Segni distintivi Uniformi di gara Casa Trasferta Terza divisa Colori sociali Dati societari Città Nova Gorica Nazione  Slovenia Confederazione UEFA Federazione NZS Campionato 2. SNL Fondazione 1947 Presidente Hari Arčon Allenatore Agron Salja St...

 

 

Moscow Metro station KutuzovskayaКутузовскаяMoscow Metro stationGeneral informationLocationDorogomilovo DistrictWestern Administrative OkrugMoscowRussiaCoordinates55°44′24″N 37°32′04″E / 55.7399°N 37.5344°E / 55.7399; 37.5344Owned byMoskovsky MetropolitenLine(s) Filyovskaya linePlatforms2 side platformsTracks2ConstructionStructure typeGround-level, openPlatform levels1ParkingNoOther informationStation code059HistoryOpened7 November 1958...

 

 

Lawrence v. TexasMahkamah Agung Amerika SerikatDisidangkan pada March 26, 2003Diputus pada June 26, 2003Nama lengkap kasusJohn Geddes Lawrence and Tyron Garner v TexasDocket nos.02-102Kutipan539 U.S. 558 (lanjut)123 S. Ct. 2472; 156 L. Ed. 2d 508; 2003 U.S. LEXIS 5013; 71 U.S.L.W. 4574; 2003 Cal. Daily Op. Service 5559; 2003 Daily Journal DAR 7036; 16 Fla. L. Weekly Fed. S 427Versi sebelumnyaDefendants convicted, Harris County Criminal Court (1999), rev'd, 2000 WL 729417 (Tex. App. 2000) (dep...

American voice actress (born 1952 or 1953) Ellen McLainMcLain at the 2017 Game On ExpoBorn1952 or 1953 (age 70–71)[1]OccupationVoice actressYears active2004–presentSpouse John Patrick Lowrie ​(m. 1986)​Websiteellenmclain.net Ellen McLain (born 1952 or 1953) is an American voice actress. She is best known for providing the voice of GLaDOS, the primary antagonist of the Portal video game series, the Combine Overwatch AI in Half-Life...

 

 

2020年夏季奥林匹克运动会波兰代表團波兰国旗IOC編碼POLNOC波蘭奧林匹克委員會網站olimpijski.pl(英文)(波兰文)2020年夏季奥林匹克运动会(東京)2021年7月23日至8月8日(受2019冠状病毒病疫情影响推迟,但仍保留原定名称)運動員206參賽項目24个大项旗手开幕式:帕维尔·科热尼奥夫斯基(游泳)和马娅·沃什乔夫斯卡(自行车)[1]闭幕式:卡罗利娜·纳亚(皮划艇)&#...

 

 

Artikel ini sebatang kara, artinya tidak ada artikel lain yang memiliki pranala balik ke halaman ini.Bantulah menambah pranala ke artikel ini dari artikel yang berhubungan atau coba peralatan pencari pranala.Tag ini diberikan pada Desember 2022. SMP Negri 8 BatamInformasiJenisSekolah NegeriAlamatLokasiJl. Hang Lekiu - Nongsa, Batam, Kepri,  IndonesiaMoto SMP Negeri (SMPN) 8 Batam, merupakan salah satu Sekolah Menengah Pertama Negeri yang ada di Provinsi Kepulauan Riau, yang beralamat di ...

2018 South Korean television series The UndateablesPromotional posterHangul훈남정음Literal meaningHoon-nam and Jung-eumRevised RomanizationHunnamjeong-eum GenreRomance comedyWritten byLee Jae-yoonDirected byKim Yoo-jinStarringNamkoong MinHwang Jung-eumCountry of originSouth KoreaOriginal languageKoreanNo. of episodes32ProductionExecutive producersKim Jung-heeYoo Byung-sulCinematographyBae Hong-sooLee Moo-jinMoon Ji-seobEditorsPark Sung-heeOh Jin-ahKim Min-jiCamera setupSingle-cameraRunnin...

 

 

  关于1978年首次發表的一個中國政治訴求,請見「第五個現代化 (魏京生)」。 本条目是习近平系列的一部分 党总书记・最高领导人・领导核心 中共十八大 2012年当选总书记 中共十九大 2017年连任总书记 2018年修改宪法 中共二十大 2022年再任总书记 習近平派系 以习近平同志为核心的党中央(第五代中央领导集体) 习近平新时代中国特色社会主义思想 社会主义核心价�...

 

 

Susunan batu Lembah Bujang. Model rekaan fiktif[butuh rujukan] mengenai bangunan Lembah Bujang, Kedah Lama, dipamerkan di Museum Negara Malaysia, Kuala Lumpur. Lembah Bujang adalah sebuah susunan batu dan pelataran yang diklaim sebagai bekas peninggalan sebuah candi di kawasan situs purbakala Lembah Bujang, yang mana juga diklaim sebagai peninggalan kerajaan Kedah,[butuh rujukan] walaupun tidak didasari dengan bukti otentik apapun. Kompleks susunan batu Lembah Bujang adalah sa...

Resolusi 1508Dewan Keamanan PBBSierra LeoneTanggal19 September 2003Sidang no.4.829KodeS/RES/1508 (Dokumen)TopikSituasi di Sierra LeoneRingkasan hasil15 mendukungTidak ada menentangTidak ada abstainHasilDiadopsiKomposisi Dewan KeamananAnggota tetap Tiongkok Prancis Rusia Britania Raya Amerika SerikatAnggota tidak tetap Angola Bulgaria Chili Kamerun Spanyol Jerman Guinea Meksiko Pakistan Syria Resolusi 1508 Dew...

 

 

En strikeout. Strikeout (förkortat SO eller K[1]) är en statistisk kategori i baseboll. Den är en av de viktigaste för en pitcher. En strikeout uppstår när en pitcher lyckas kasta tre strikes förbi motståndarlagets slagman och leder i nästan alla fall till att slagmannen blir bränd. En strike är ett kast som går igenom strikezonen, vilket är en tänkt rymd i luften ovanför hemplattan (engelska: home plate). Det blir även en strike om slagmannen svingar slagträt, oberoende av o...

 

 

  ميّز عن لغة صوربية. الصربية الاسم الذاتي српски jезик, srpski jezik   الناطقون 11 مليون الدول صربيا والجبل الأسود، البوسنة والهرسك، كرواتيا المنطقة البلقان الرتبة 75 الكتابة سيريلية، لاتينية النسب هندية أوروبية لغات هندية أوروبيةلغات بلطيقية سلافيةلغات سلافيةلغات سلاف�...

Pemilihan umum Bupati Banggai Kepulauan 20242017202927 November 2024Kandidat Peta persebaran suara Peta Provinsi Sulawesi Tengah yang menyoroti Kabupaten Banggai Kepulauan Bupati petahanaIhsan Basir (Penjabat) Bupati & Wakil Bupati terpilih Belum diketahui Pemilihan umum Bupati Banggai Kepulauan 2024 dilaksanakan pada 27 November 2024 untuk memilih Bupati Banggai Kepulauan periode 2024–2029.[1] Pemilihan Bupati Banggai Kepulauan tahun tersebut akan diselenggarakan setelah Pemil...

 

 

Use of cannabis in Turkmenistan Cannabis in TurkmenistanLocation of Turkmenistan (red)MedicinalIllegalRecreationalIllegal Cannabis is illegal in Turkmenistan. Cannabis was grown in the region for hemp oil until the 1870s, even though by that point it had been supplanted for fiber uses by Russian hemp. The Turkmen people grew cannabis indica, with male plants being used for fiber and females for seeds and bhang.[1] References ^ Duvall, Chris (2014-11-15). Cannabis. Reaktion Books. ISBN...