Interface de programación de aplicación

A interface de programación de aplicación (do inglés application programming interface) fai referencia aos servizos (funcións e funcionalidades) dos que un determinado módulo software (peza, compoñente) prové outros módulos. A interface proporciona unha transparencia en canto á implementación interna desas funcionalidades nese módulo de software: a implementación pode trocar e soamente se ve afectada a implementación nese módulo (da que prové tal API), sen se veren afectados os módulos que usan a tal API[1].

Son usadas xeralmente nas bibliotecas de programación[1].

Características

Unha API representa unha interface de comunicación entre compoñentes de software. Trátase do conxunto de chamadas a certas bibliotecas que ofrecen acceso a certos servizos desde os procesos e representa un método para conseguir abstracción na programación, xeralmente (aínda que non necesariamente) entre os niveis ou capas inferiores e os superiores do software. Un dos principais propósitos dunha API consiste en proporcionar un conxunto de funcións de uso xeral, por exemplo, para debuxar fiestras ou iconas na pantalla. Desta forma, os programadores benefícianse das vantaxes da API facendo uso da súa funcionalidade, evitándose o traballo de programar todo desde o principio. As API así mesmo son abstractas: o software que proporciona unha certa API xeralmente é chamado a implementación desa API.

Por exemplo, pódese ver a tarefa de escribir "Ola Mundo" sobre a pantalla en diferentes niveis de abstracción:

  1. Facendo todo o traballo desde o principio:
    1. Traza, sobre papel milimetrado, a forma das letras (e espazo) "O, l, a, M, u, n, d, o".
    2. Crea unha matriz de cadrados negros e brancos que se asemelle á sucesión de letras.
    3. Mediante instrucións en ensamblador, escribe a información da matriz na memoria intermedia ("buffer") de pantalla.
    4. Mediante a instrución adecuada, fai que a tarxeta gráfica realice o envorcado desa información sobre a pantalla.
  2. Por medio dun sistema operativo para formar parte do traballo:
    1. Carga unha fonte tipográfica proporcionada polo sistema operativo.
    2. Fai que o sistema operativo borre a pantalla.
    3. Fai que o sistema operativo debuxe o texto "Ola Mundo" usando a fonte cargada.
  3. Usando unha aplicación (que á súa vez usa o sistema operativo) para realizar a maior parte do traballo: escribe un documento HTML coas palabras "Ola Mundo" para que un navegador web como Firefox, Chrome, Opera, Safari, Midori, Iceweasel, Web o Microsoft Edge poida representalo no monitor.

Como se pode ver, a primeira opción require máis pasos, cada un dos cales é moito máis complicado que os pasos das opcións seguintes. Ademais, non resulta nada práctico usar a primeira formulación para representar unha gran cantidade de información, como un artigo enciclopédico sobre a pantalla, mentres que o segundo enfoque simplifica a tarefa eliminando un paso e facendo o resto máis sinxelos e a terceira forma simplemente require escribir "Ola Mundo". Con todo, as API de alto nivel xeralmente perden flexibilidade; por exemplo, resulta moito máis difícil nun navegador web facer virar texto ao redor dun punto cun contorno intermitente que programalo a baixo nivel. Ao elixir usar unha API débese chegar a un certo equilibrio entre a súa potencia e simplicidade e a súa perda de flexibilidade.

Exemplos de interfaces de programación

Notas

  1. 1,0 1,1 "Para qué serve unha API? Solventa por fin esta dúbida.". Pandora FMS (en español). 14 de febreiro de 2019. Consultado o 22 de xullo de 2020. 

Véxase tamén

Outros artigos

Ligazons externas

Read other articles:

Salah satu bangunan di Dora, Alabama Dora adalah sebuah kota di Walker County, Alabama, Amerika Serikat. Pemukim pertama di daerah itu adalah James. M. Davis dan Yehezkiel Morgan pada tahun 1830-an dan kota ini didirikan oleh Cole Smith.[1] Ini awalnya dimasukkan sebagai kota Horse Creek pada 18 Februari 1897, tetapi berubah nama menjadi Dora pada tahun 1906.[1] Pada sensus penduduk tahun 2020 berjumlah 2.297, naik dari 2.024 pada tahun 2010. Geografi Menurut Biro Sensus AS, k...

Protein-coding gene in the species Homo sapiens IGFBP4Available structuresPDBOrtholog search: PDBe RCSB List of PDB id codes1WQJ, 2DSP, 2DSQ, 2DSRIdentifiersAliasesIGFBP4, BP-4, HT29-IGFBP, IBP4, IGFBP-4, insulin like growth factor binding protein 4External IDsOMIM: 146733 MGI: 96439 HomoloGene: 1192 GeneCards: IGFBP4 Gene location (Human)Chr.Chromosome 17 (human)[1]Band17q21.2Start40,443,450 bp[1]End40,457,725 bp[1]Gene location (Mouse)Chr.Chromosome 11 (mouse)[2&...

Leipzig BayrakArma LeipzigUlke AlmanyaEyalet SaksonyaBağımsız şehir (Kreisfreie Städte)Leipzigİdare • Belediye başkanıBurkhard Jung (SPD)Yüzölçümü • Toplam297,60 km²Nüfus (31 Aralık 2018) • Toplam596,517 • Kent1,016,048 • Metropol3,500,000Zaman dilimiUTC+01.00 (OAS) • Yaz (YSU)UTC+02.00 (OAYS)Posta kodu04001-04357Alan kodu0341Resmî siteLeipzig.de Leipzig, Almanya'nın Saksonya eyaletine bağlı 590.0...

Saint Paul Charlestown Parroquia Coordenadas 17°08′09″N 62°36′37″O / 17.135833, -62.610278Capital CharlestownEntidad Parroquia • País  San Cristóbal y Nieves • Isla NievesSuperficie   • Total 4 km²Población (2001)   • Total 1820 hab. • Densidad 513,06 hab/km²Huso horario UTC−4 y America/St_Kitts[editar datos en Wikidata] Saint Paul Charlestown es una de las cinco parroquias de la isla Nieves...

  ساربسبورغ   ساربسبورغ ساربسبورغ  خريطة الموقع تاريخ التأسيس 1839[1]  تقسيم إداري البلد النرويج  [2][3] عاصمة لـ أوستفولد  التقسيم الأعلى فيكن (1 يناير 2020–)  خصائص جغرافية إحداثيات 59°17′26″N 11°12′10″E / 59.290556°N 11.202778°E / 59.290556; 11.202778  [4]

Shire of Towong Local Government Area van Australië Locatie van Towong Shire in Victoria Situering Staat Victoria Hoofdplaats Tallangatta Coördinaten 36°19'0ZB, 147°29'0OL Algemene informatie Oppervlakte 6.635 km² Inwoners 6.181 (juni 2006) Portaal    Australië Towong Shire is een Local Government Area (LGA) in Australië in de staat Victoria. Towong Shire telt 6.181 inwoners. De hoofdplaats is Tallangatta.

  لمعانٍ أخرى، طالع رينالدو (توضيح). هذه المقالة يتيمة إذ تصل إليها مقالات أخرى قليلة جدًا. فضلًا، ساعد بإضافة وصلة إليها في مقالات متعلقة بها. (أغسطس 2022) رينالدو معلومات شخصية الميلاد 19 مارس 1970 (53 سنة)  الطول 1.71 م (5 قدم 7 1⁄2 بوصة) مركز اللعب مهاجم الجنسية الب

2008 Tamil drama film DhanamTheatrical release posterDirected byG. ShivaWritten byG. ShivaProduced byS. KousalyaraniStarringSangeethaKota Srinivasa RaoAshish VidyarthiManobalaKarunasPremGirish KarnadCinematographySrinivas DevamsamEdited byB. LeninMusic byIlayarajaDistributed bySri Nandhimedu Selliaamman MoviesRelease date5 September 2008Running time154 minutesCountryIndiaLanguageTamil Dhanam (Tamil: தனம்) is a 2008 Tamil-language drama film written and directed by G. Shiva. The film s...

Cephalic part of an animal For other uses, see Head (disambiguation). HeadThe head of a meerkatIdentifiersTA98A01.1.00.001TA298FMA7154Anatomical terminology[edit on Wikidata] A head is the part of an organism which usually includes the ears, brain, forehead, cheeks, chin, eyes, nose, and mouth, each of which aid in various sensory functions such as sight, hearing, smell, and taste. Some very simple animals may not have a head, but many bilaterally symmetric forms do, regardless of size. H...

1966 film by B. R. Panthulu Namma Veettu LakshmiDirected byB. R. PanthuluStory byMa RaProduced byB. R. PanthuluStarringB. R. PanthuluM. V. RajammaCinematographyV. RamamurthyEdited byR. DevarajanMusic byM. S. ViswanathanProductioncompanyPadmini PicturesRelease date 5 August 1966 (1966-08-05) CountryIndiaLanguageTamil Namma Veettu Lakshmi (transl. Lakshmi of our home) is a 1966 Indian Tamil-language drama film produced and directed by B. R. Panthulu. It is a remake of his o...

Universitas HKBP NommensenMotoPro Deo et Patria (Bagi Tuhan dan Ibu Pertiwi)JenisPerguruan Tinggi SwastaDidirikan7 Oktober 1954; 69 tahun lalu (1954-10-07)AfiliasiProtestanRektorDr. Richard A.M. Napitupulu, M.T. (Kampus Medan)Dr. Muktar B. Panjaitan, M.Pd. (Kampus Pematang Siantar)[1]Staf akademik345 (T.A 2021/2022)[2]Jumlah mahasiswa11.385 (T.A 2021/2022)[2]AlamatJalan Dr Sutomo No 4-A, Kota Medan, Sumatera Utara, IndonesiaKampusUrbanWarnaBiru Tua  Nama julu...

Soap opera character Jenny WolekOne Life to Live characterBrynn Thayer as Jenny WolekPortrayed byKatherine Glass (1975–1978)Brynn Thayer (1978–1986)Duration1975–1986First appearanceJune 1975 (June 1975)Last appearanceMay 1986 (May 1986)ClassificationFormer, regularCreated byAgnes NixonGordon RussellIntroduced byDoris QuinlanIn-universe informationOther namesJenny Wolek (maiden name)Occupation Physician at Llanview Hospital Secretary Novitiate nun Famil...

City in Ontario, CanadaLondonCity (single-tier)City of LondonFrom top, left to right: Downtown London skyline, Budweiser Gardens, Victoria Park, Financial District, London Normal School FlagCoat of armsNickname: The Forest CityMotto(s): Labore et Perseverantia  (Latin)Through Labour and PerseveranceLondonCoordinates: 42°58′03″N 81°13′57″W / 42.96750°N 81.23250°W / 42.96750; -81.23250[1]CountryCanadaProvinceOntarioSettled1826 (as ...

Place in Aruba, NetherlandsOranjestad WestKingdom NetherlandsCountry ArubaArea • Total929 ha (2,296 acres)Population (2010)[1] • Total13,976 • Density1,500/km2 (3,900/sq mi) Oranjestad West[2] It is one of the 9 regions[3] into which the Caribbean island of Aruba, an autonomous country within the Kingdom of the Netherlands, is divided. Eagle Beach, Aruba Geography It is located northwest of the main isla...

Siklon Flores 1973Siklon tropis parah kategori 3 (skala Aus.)Siklon tropis kategori 3 (SSHWS)Citra satelit siklon pada 28 AprilTerbentuk pada26 April 1973 (26 April 1973)Mereda pada30 April 1973 (30 April 1973) Kecepatan anginmaksimal10 menit: 150 km/jam 1 menit: 185 km/jam Tekanan minimal950 hPa (mbar) Korban jiwaTotal 1,653 (Siklon tropis paling mematikan yang pernah diketahui terjadi di belahan Bumi selatan)Area terdampakIndonesia, Timor PortugisBagian dari Musim siklon wila...

1987 biographical film by Bernardo Bertolucci For other uses, see Last Emperor (disambiguation). The Last EmperorTheatrical release posterDirected byBernardo BertolucciScreenplay by Mark Peploe Bernardo Bertolucci Based onFrom Emperor to Citizen: The Autobiography of Aisin-Gioro Puyi1960 autobiographyby PuyiProduced byJeremy ThomasStarring John Lone Joan Chen Peter O'Toole Ying Ruocheng Victor Wong Dennis Dun Vivian Wu Ryuichi Sakamoto CinematographyVittorio StoraroEdited byGabriella Cristian...

This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Villains' Lorebook – news · newspapers · books · scholar · JSTOR (April 2013) (Learn how and when to remove this template message) Villains' Lorebook GenreRole-playing gamesPublisherTSR Villains' Lorebook is an accessory for the Forgotten Realms campaign settin...

This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Electromagnetic wave equation – news · newspapers · books · scholar · JSTOR (February 2022) (Learn how and when to remove this template message) Partial differential equation used in physics The electromagnetic wave equation is a second-order partial differenti...

Indian-born Canadian film director and screenwriter Deepa MehtaDeepa Mehta in 2005Born (1950-09-15) 15 September 1950 (age 73)Amritsar, East Punjab, IndiaNationalityCanadianOccupation(s)Film director, screenwriter, film producerYears active1976–presentKnown forElements TrilogySpouse(s) Paul Saltzman ​ ​(m. 1973; div. 1983)​ David Hamilton (– present)ChildrenDevyani Saltzman (daughter)RelativesDilip Mehta (brother)Websitewww.ha...

Julius Schreck BrigadeführerFödd13 juli 1898München, Kungariket Bayern, Kejsardömet TysklandDöd16 maj 1936 (37 år)München, Bayern, TysklandBegravningsplatsFriedhof Gräfeling, MünchenInträde1925Tjänstetid1925–1936BefälReichsführer-SS 1925–1926 Julius Schreck (andre från vänster) tillsammans med Adolf Hitler år 1925. De övriga är Julius Schaub, Hansjörg Maurer och Edmund Schneider. Julius Schreck, född 13 juli 1898 i München, död 16 maj 1936 i München, var en tys...