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. The result is that the users re-implement the required functions in terms of the interface, which in its turn uses the internal implementation of the same functions. This may result in implementing lower-level features in terms of higher-level ones, thus the term 'abstraction inversion'.

Possible ill-effects are:

  • The user of such a re-implemented function may seriously underestimate its running-costs.
  • The user of the construct is forced to obscure their implementation with complex mechanical details.
  • Many users attempt to solve the same problem, increasing the risk of error.

Examples

Alleged examples from professional programming circles include:

  • In Ada, choice of the rendezvous construct as a synchronisation primitive forced programmers to implement simpler constructs such as semaphores on the more complex basis.[1]
  • In Applesoft BASIC, integer arithmetic was implemented on top of floating-point arithmetic, and there were no bitwise operators and no support for blitting of raster graphics (even though the language supported vector graphics on the Apple II's raster hardware). This caused games and other programs written in BASIC to run slower.
  • Like Applesoft BASIC, Lua has a floating-point type as its sole numeric type[2] when configured for desktop computers,[3] and it had no bitwise operators prior to Lua 5.2.[4]
  • Creating an object to represent a function is cumbersome in object-oriented languages such as Java and C++ (especially prior to C++11 and Java 8), in which functions are not first-class objects. In C++ it is possible to make an object 'callable' by overloading the () operator, but it is still often necessary to implement a new class, such as the Functors in the STL. (C++11's lambda function makes it much easier to create an object representing a function.)
  • Tom Lord has suggested that Subversion version control system pays for the abstraction inversion of implementing a write-only database on a read/write database with poor performance.[5]
  • Using stored procedures to manipulate data in a relational database, without granting programmers right to deploy such procedures, leads to reimplementing queries outside the database. For example, large datasets (in extreme cases - whole tables) are fetched and actual filtering takes place in application code. Alternatively, thousands of rows are updated (inserted or even fetched) one by one instead of running a multiple row query.
  • Microsoft's WinUI 3 systematically replaces the title bar of the windows it creates with a custom one that ignores the end-user's color settings, always appearing gray instead. Applying the end-user's chosen color to the title bar requires using further customization code on Windows 11, and completely replacing the custom title bar with another custom one on Windows 10.[6]

Examples that are common outside professional programming circles include:

  • Using spreadsheet lookup functions to replicate the functionality of a database
  • Using variant data types as loop counters in Microsoft Visual Basic where an integer type is also available.

See also

References

  1. ^ Critique of DIN Kernel Lisp Definition Version 1.2, footnote 2 Archived 2018-05-06 at the Wayback Machine - says (without references) that the term derives from critiques of the Ada rendezvous, appears to be one of the earliest uses.
  2. ^ Programming in Lua : 2.3 - Numbers Accessed 2009-10-12.
  3. ^ lua-users c2: Floating Point Accessed 2009-10-12.
  4. ^ lua-users c2: Bitwise Operators Accessed 2013-01-15.
  5. ^ sourcefrog : Tom Lord on Subversion
  6. ^ Title bar customization - Windows apps | Microsoft Learn
  • Abstraction Inversion at Portland Pattern Repository - extensive discussion, much of it taking "abstraction inversion" in the sense of "concealed complexity"

Read other articles:

Bir Annenin Günahı adalah sebuah seri drama televisi Turki tahun 2022 yang disutradarai oleh Mehmet Ada Öztekin. Seri tersebut menampilkan Nurgül Yeşilçay, Tuna Orhan dan Mert Yazıcıoğlu.[1] Sinopsis Seorang ibu bernama Suna telah lama menjalani hidupnya dengan penuh pengorbanan untuk keluarganya. Dia adalah seorang ibu tunggal yang mencoba keras untuk memberikan kehidupan yang lebih baik kepada kedua anaknya, Cem dan Deniz. Namun, hidup Suna penuh dengan rahasia yang gelap. ...

 

Cet article concerne l'État irlandais entre 1922 et 1937. Pour l'État unilatéralement proclamé en 1919, voir République irlandaise (1919). Pour la région autonome du Royaume-Uni en 1921 et 1922, voir Irlande du Sud. Pour l'actuel État irlandais, voir Irlande (pays). Pour les articles homonymes, voir IFS. État libre d'Irlande(ga) Saorstát Éireann (en) Irish Free State 6 décembre 1922 – 29 décembre 1937(15 ans et 23 jours)Drapeau Blason Carte de ...

 

City in Ontario, Canada This article is about the city in Canada. For other uses, see Brampton (disambiguation). 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: Brampton – news · newspapers · books · scholar · JSTOR (April 2024) (Learn how and when to remove this template message) City in Ontario, CanadaBram...

Former state electoral district of New South Wales, Australia For the NSW Legislative Council electorate (1843-1856), see Electoral district of Counties of Cook and Westmoreland. District of Cook and WestmorelandNew South Wales—Legislative AssemblyCook county in the 1840sStateNew South WalesCreated1856Abolished1859NamesakeCook & Westmoreland countiesCoordinates33°32′S 150°7′E / 33.533°S 150.117°E / -33.533; 150.117 Westmoreland county in the 1840s Cook an...

 

Wahyu 15Wahyu 13:16-14:4 yang tertulis pada fragmen Papirus 47 dari abad ke-3 M.KitabKitab WahyuKategoriApokalipsBagian Alkitab KristenPerjanjian BaruUrutan dalamKitab Kristen27← pasal 14 pasal 16 → Wahyu 15 (disingkat Why 15) adalah bagian dari Wahyu kepada Yohanes, kitab terakhir dalam Perjanjian Baru di Alkitab Kristen.[1][2] Pengarangnya diyakini adalah Yohanes bin Zebedeus, seorang dari Keduabelas Rasul Yesus Kristus.[3][4][5] Teks Nask...

 

Giant planet primarily consisting of compounds with freezing points exceeding 100°K This article is about the type of planet. For other uses, see Ice giant (disambiguation). Uranus photographed by Voyager 2 in January 1986Neptune photographed by Voyager 2 in August 1989 An ice giant is a giant planet composed mainly of elements heavier than hydrogen and helium, such as oxygen, carbon, nitrogen, and sulfur. There are two ice giants in the Solar System: Uranus and Neptune. In astrophysics and ...

British actor For other people named Ernest Clark, see Ernest Clark (disambiguation). This article includes a list of general references, but it lacks sufficient corresponding inline citations. Please help to improve this article by introducing more precise citations. (March 2013) (Learn how and when to remove this message) Ernest ClarkBorn(1912-02-12)12 February 1912Maida Vale, London, EnglandDied11 November 1994(1994-11-11) (aged 82)Hinton St. George, Somerset, EnglandYears active...

 

本條目存在以下問題,請協助改善本條目或在討論頁針對議題發表看法。 此條目需要編修,以確保文法、用詞、语气、格式、標點等使用恰当。 (2013年8月6日)請按照校對指引,幫助编辑這個條目。(幫助、討論) 此條目剧情、虛構用語或人物介紹过长过细,需清理无关故事主轴的细节、用語和角色介紹。 (2020年10月6日)劇情、用語和人物介紹都只是用於了解故事主軸,輔助�...

 

本條目存在以下問題,請協助改善本條目或在討論頁針對議題發表看法。 此條目需要編修,以確保文法、用詞、语气、格式、標點等使用恰当。 (2013年8月6日)請按照校對指引,幫助编辑這個條目。(幫助、討論) 此條目剧情、虛構用語或人物介紹过长过细,需清理无关故事主轴的细节、用語和角色介紹。 (2020年10月6日)劇情、用語和人物介紹都只是用於了解故事主軸,輔助�...

Pour les articles homonymes, voir Parsons. Cet article est une ébauche concernant une université américaine et New York. Vous pouvez partager vos connaissances en l’améliorant (comment ?) selon les recommandations des projets correspondants. Parsons The New School for DesignHistoireFondation 1896StatutType Enseignement supérieur privéRégime linguistique AnglaisFondateur William Merritt ChaseMembre de American Council on Education (en)Site web www.newschool.edu/parsonsLocalisati...

 

Disambiguazione – Se stai cercando altri significati, vedi Meo Patacca (disambigua). Meo PataccaTitolo originaleIl Meo Patacca o vero Roma in feste nei trionfi di Vienna Immagine tratta dalla Tavola 52: Nuccia accetta Meo Patacca come sposo AutoreGiuseppe Berneri 1ª ed. originale1695 Generepoema Sottogenereeroicomico Lingua originaleromanesco Ambientazionela Roma papalina del XVII secolo ProtagonistiMeo Patacca Altri personaggiNuccia, Calfurnia, Marco Pepe Modifica dati su Wikidata �...

 

8-Hydroxyquinoline Names Preferred IUPAC name Quinolin-8-ol Other names 1-Azanaphthalene-8-ol, Fennosan H 30, Hydroxybenzopyridine, Oxybenzopyridine, Oxychinolin, Oxyquinoline, Phenopyridine, Quinophenol, Oxine, 8-Quinolinol Identifiers CAS Number 148-24-3 Y 3D model (JSmol) Interactive image ChEBI CHEBI:48981 Y ChEMBL ChEMBL310555 Y ChemSpider 1847 Y ECHA InfoCard 100.005.193 KEGG D05321 Y PubChem CID 1923 UNII 5UTX5635HP Y CompTox Dashboard (EPA) DTXSID5020730...

LGBT rights in SwitzerlandLocation of Switzerland (greenBeat Flach)in Europe (dark grey)  –  [Legend]StatusLegal in Geneva, Ticino, Vaud, and Valais since 1798; legal nationwide since 1942 Age of consent equalised in 1992 through referendumGender identityTransgender people allowed to change legal genderMilitaryGays, lesbians and bisexuals allowed to serve openlyDiscrimination protectionsSexual orientation protections (see below)Family rightsRecognition of r...

 

1920s British flying boat Sheldrake Role Amphibian biplane flying boatType of aircraft National origin United Kingdom Manufacturer Supermarine Designer R.J. Mitchell First flight 1927 Produced 1923 Number built 1 Developed from Supermarine Seagull The Supermarine Sheldrake was a British amphibian biplane flying boat developed by Supermarine from the Supermarine Seagull with a revised hull.[1] It was powered by a Napier Lion engine mounted between the wings driving a four-bladed propel...

 

تشكل الحياة السياسية في إنجلترا الجزء الأكبر من الحياة السياسية الأوسع نطاقًا للمملكة المتحدة، باعتبار إنجلترا أكثر اكتظاظًا بالسكان من جميع البلدان الأخرى في المملكة المتحدة مجتمعة. ونظرًا لأن إنجلترا أيضًا هي الأكبر من حيث المساحة والناتج المحلي الإجمالي، فإن علاقته�...

City in Vinnytsia Oblast, Ukraine This article is about the city in Ukraine. For the city in Belarus, see Mogilev. City in Vinnytsia Oblast, UkraineMohyliv-Podilskyi Могилів-ПодільськийCity FlagCoat of armsMohyliv-PodilskyiLocation in UkraineShow map of Vinnytsia OblastMohyliv-PodilskyiMohyliv-Podilskyi (Ukraine)Show map of UkraineCoordinates: 48°27′0″N 27°47′0″E / 48.45000°N 27.78333°E / 48.45000; 27.78333Country UkraineOblastVinnyts...

 

Sân vận động tỉnh Thanh HóaLocationThanh Hóa, VietnamCapacity14,000TenantsDong A Thanh Hoa FC The Thanh Hóa Stadium is a multi-use stadium in Thanh Hóa, Vietnam. It is currently used mostly for football matches and is the home stadium of Dong A Thanh Hoa FC of the V.League 1. The stadium holds 14,000 spectators. References External links Stadium information 19°47′57″N 105°46′22″E / 19.799141°N 105.772746°E / 19.799141; 105.772746 vteV.League 1 v...

 

Korean Religious Leader (1918–1985) In this Korean name, the family name is Ahn. This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages) Some of this article's listed sources may not be reliable. Please help improve this article by looking for better, more reliable sources. Unreliable citations may be challenged and removed. (March 2024) (Learn how and when to remove this message) This article ...

This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages) 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: 30/30-150 – news · newspapers · books · scholar · JSTOR (January 2008) (Learn how and when to remove this m...

 

Dikdik Mulyana Arief Mansur Kepala Kepolisian Daerah Sumatera SelatanMasa jabatan30 Juni 2011 – 24 November 2012PendahuluHasyim IriantoPenggantiIskandar HasanKepala Kepolisian Daerah Kepulauan Riau ke-4Masa jabatan27 Januari 2009 – 4 September 2009PendahuluIndradi ThanosPenggantiPudji Hartanto Iskandar Informasi pribadiLahir14 Juni 1955 (umur 69)Tasikmalaya, Jawa Barat, IndonesiaKebangsaanIndonesiaAlma materAkademi Kepolisian (1978)Universitas PadjadjaranKarier ...