Leaky abstraction

Last updated

A leaky abstraction in software development refers to a design flaw where an abstraction, intended to simplify and hide the underlying complexity of a system, fails to completely do so. This results in some of the implementation details becoming exposed or 'leaking' through the abstraction, forcing users to have knowledge of these underlying complexities to effectively use or troubleshoot the system. [1]

Contents

The concept was popularized by Joel Spolsky, who coined the term Law of Leaky Abstractions which states: [2]

All non-trivial abstractions, to some degree, are leaky.

This means that even well-designed abstractions may not fully conceal their inner workings, and as computer systems grow more complex, the likelihood of such leaks increases. These leaks can lead to performance issues, unexpected behavior, and increased cognitive load on software developers, who are forced to understand both the abstraction and the underlying details it was meant to hide. This highlights a cause of software defects: the reliance of the software developer on an abstraction's infallibility. Despite their imperfections, abstractions are crucial in software development for managing complexity, even though they are not always flawless.

History

The term "leaky abstraction" was popularized in 2002 by Joel Spolsky. [2] [3] A 1992 paper by Kiczales describes some of the issues with imperfect abstractions and presents a potential solution to the problem by allowing for the customization of the abstraction itself. [4]

Effect on software development

As systems become more complex, software developers must rely upon more abstractions. Each abstraction tries to hide complexity, letting a developer write software that "handles" the many variations of modern computing.

However, this law claims that developers of reliable software must learn the abstraction's underlying details anyway.

Examples

Spolsky's article cites many examples of leaky abstractions that create problems for software development:

In 2020, Massachusetts Institute of Technology computing science teaching staff Anish, Jose, and Jon argued that the command line interface for git is a leaky abstraction, in which the underlying "beautiful design" of the git data model needs to be understood for effective usage of git. [5]

See also

Related Research Articles

Object–relational mapping in computer science is a programming technique for converting data between a relational database and the memory of an object-oriented programming language. This creates, in effect, a virtual object database that can be used from within the programming language.

In software engineering and computer science, abstraction is the process of generalizing concrete details, such as attributes, away from the study of objects and systems to focus attention on details of greater importance. Abstraction is a fundamental concept in computer science and software engineering, especially within the object-oriented programming paradigm. Examples of this include:

<span class="mw-page-title-main">Object–relational database</span> Database management system

An object–relational database (ORD), or object–relational database management system (ORDBMS), is a database management system (DBMS) similar to a relational database, but with an object-oriented database model: objects, classes and inheritance are directly supported in database schemas and in the query language. Also, as with pure relational systems, it supports extension of the data model with custom data types and methods.

A query language, also known as data query language or database query language (DQL), is a computer language used to make queries in databases and information systems. In database systems, query languages rely on strict theory to retrieve information. A well known example is the Structured Query Language (SQL).

<span class="mw-page-title-main">Microsoft WebMatrix</span>

Microsoft WebMatrix is a discontinued cloud-connected website builder and HTML editor for Windows, geared towards web development. WebMatrix enables developers to build websites using built-in templates or popular open-source applications, with full support for ASP.NET, PHP, Node.js and HTML5. Microsoft developed WebMatrix for the purpose of providing web developers with coding, customization, and publishing capabilities all in one place.

<span class="mw-page-title-main">Joel Spolsky</span> American software engineer and writer

Avram Joel Spolsky is a software engineer and writer. He is the author of Joel on Software, a blog on software development, and the creator of the project management software Trello. He was a Program Manager on the Microsoft Excel team between 1991 and 1994. He later founded Fog Creek Software in 2000 and launched the Joel on Software blog. In 2008, he launched the Stack Overflow programmer Q&A site in collaboration with Jeff Atwood. Using the Stack Exchange software product which powers Stack Overflow, the Stack Exchange Network now hosts over 170 Q&A sites.

In software, a data access object (DAO) is a pattern that provides an abstract interface to some type of database or other persistence mechanism. By mapping application calls to the persistence layer, the DAO provides data operations without exposing database details. This isolation supports the single responsibility principle. It separates the data access the application needs, in terms of domain-specific objects and data types, from how these needs can be satisfied with a specific DBMS.

A database abstraction layer is an application programming interface which unifies the communication between a computer application and databases such as SQL Server, IBM Db2, MySQL, PostgreSQL, Oracle or SQLite. Traditionally, all database vendors provide their own interface that is tailored to their products. It is up to the application programmer to implement code for the database interfaces that will be supported by the application. Database abstraction layers reduce the amount of work by providing a consistent API to the developer and hide the database specifics behind this interface as much as possible. There exist many abstraction layers with different interfaces in numerous programming languages. If an application has such a layer built in, it is called database-agnostic.

Hibernate ORM is an object–relational mapping tool for the Java programming language. It provides a framework for mapping an object-oriented domain model to a relational database. Hibernate handles object–relational impedance mismatch problems by replacing direct, persistent database accesses with high-level object handling functions.

ADO.NET is a data access technology from the Microsoft .NET Framework that provides communication between relational and non-relational systems through a common set of components. ADO.NET is a set of computer software components that programmers can use to access data and data services from a database. It is a part of the base class library that is included with the Microsoft .NET Framework. It is commonly used by programmers to access and modify data stored in relational database systems, though it can also access data in non-relational data sources. ADO.NET is sometimes considered an evolution of ActiveX Data Objects (ADO) technology, but was changed so extensively that it can be considered an entirely new product.

In software engineering, inversion of control (IoC) is a design principle in which custom-written portions of a computer program receive the flow of control from an external source. The term "inversion" is historical: a software architecture with this design "inverts" control as compared to procedural programming. In procedural programming, a program's custom code calls reusable libraries to take care of generic tasks, but with inversion of control, it is the external source or framework that calls the custom code.

<span class="mw-page-title-main">NHibernate</span> Object–relational mapping solution

NHibernate is a port of the Hibernate object–relational mapping (ORM) tool for the Microsoft .NET platform. It provides a framework for mapping an object-oriented domain model to a traditional relational database. Its purpose is to relieve the developer from a significant portion of relational data persistence-related programming tasks. NHibernate is free and open-source software that is distributed under the GNU Lesser General Public License.

A data access layer (DAL) in computer software is a layer of a computer program which provides simplified access to data stored in persistent storage of some kind, such as an entity-relational database. This acronym is prevalently used in Microsoft environments.

Qcodo is an open-source PHP web application framework which builds an object-relational model (ORM), CRUD UI pages, and AJAX hooks from an existing data model. It additionally includes a tightly integrated HTML and JavaScript form toolkit which interfaces directly with the generated entities. It is a robust, comprehensive framework which can be utilized by small and large Web applications alike.

Entity Framework (EF) is an open source object–relational mapping (ORM) framework for ADO.NET. It was originally shipped as an integral part of .NET Framework, however starting with Entity Framework version 6.0 it has been delivered separately from the .NET Framework.

Web2py is an open-source web application framework written in the Python programming language. Web2py allows web developers to program dynamic web content using Python. Web2py is designed to help reduce tedious web development tasks, such as developing web forms from scratch, although a web developer may build a form from scratch if required.

<span class="mw-page-title-main">Db4o</span> Open source object database

db4o was an embeddable open-source object database for Java and .NET developers. It was developed, commercially licensed and supported by Actian. In October 2014, Actian declined to continue to actively pursue and promote the commercial db4o product offering for new customers.

OpenTG

OpenTG is an open-source implementation of a bulletin board system (BBS) software program written for Linux and/or Unix. Written from scratch in JRuby, the goal is to reproduce the look, feel, and functionality of similar legacy BBS systems such as Tag, Telegard, Maximus or Renegade, which were written for DOS and OS/2 during the pre-internet communication era. No original code from any BBS has been used nor referenced in order to focus on innovation and unique capabilities.

Dapper is an object–relational mapping (ORM) product for the Microsoft .NET platform. It provides a framework for mapping an object-oriented domain model to a traditional relational database. Its purpose is to relieve the developer from a significant portion of relational data persistence-related programming tasks. Dapper is free as open source software that is distributed under dual license, either the Apache License 2.0 or the MIT License.

<span class="mw-page-title-main">Movim</span>

Movim is a distributed social network built on top of XMPP, a popular open standards communication protocol. Movim is a free and open source software licensed under the AGPL-3.0-or-later license. It can be accessed using existing XMPP clients and Jabber accounts.

References

  1. Seibel, Peter (1 November 2006). Practical Common Lisp. Apress. p. 96. ISBN   978-1-4302-0017-8.
  2. 1 2 Spolsky, Joel (2002). "The Law of Leaky Abstractions" . Retrieved 2010-09-22.
  3. arvindpdmn (2019-08-23). "Leaky Abstractions". Devopedia. Retrieved 2020-07-07.
  4. Kiczales, Gregor (1992). "Towards a New Model of Abstraction in the Engineering of Software" (PDF). Archived from the original (PDF) on 2011-06-04. Retrieved 2010-02-03.
  5. "Version Control (Git)". the missing semester of your cs education. Retrieved 2020-07-31.