Information about Leaky Abstraction
A leaky abstraction is an unsatisfactory implementation of an abstraction. Unsatisfactory means any case when specific implementation details manifest themselves in some obstructive or counter-productive way, thus interfering with the abstraction. The implementation details are said to "leak through" and interfere with the simplifying assumptions supposedly enabled by the abstraction.
Within the software industry, leaky abstractions are a common source of software bugs.
The Law of Leaky Abstractions:
In the publication, Spolsky expresses this viewpoint, and supports it with reference to examples in software engineering, which is why this term is customarily used in the context of computer software and hardware.
In this context, the term isn't a misnomer, since it applies to all implementations of all abstractions.
It is most likely this notion Spolsky intended to convey by expressing the viewpoint as a "law" and attributing the "leakiness" to abstractions, rather than to imprecise implementations.
The idea that all sufficiently interesting abstractions are leaky thus has profound philosophical ramifications.
Consider the field of physics. An atom of hydrogen is an abstraction which is implemented, on a deeper level, by a set of quarks. The extent to which the nature of the quarks "leaks" through to the nature of the hydrogen atom appears to depend largely on context such as temperature. However, there's no doubt that the quark implementation leaks through; otherwise, it would not be possible to know about quarks. Humans only know they exist based on the extent to which they leak through higher-level abstractions.
In this way, the Law of Leaky Abstractions is a tautology. Any abstraction that isn't leaky cannot be distinguished from a fundamental truth. A fundamental truth is not properly an abstraction. Ergo, no abstractions are not leaky.
For example, many different brands of sound card exist, and each has different capabilities and methods of operation. It is the role of the computer's operating system to implement a sound card abstraction for programs, so that a program need not have knowledge about every possible sound card that may be present. The program tells the operating system's sound card abstraction what sound to make, and the operating system then tells the sound card to make the sound using the mechanisms and capabilities unique to that sound card. If the abstraction isn't leaky, then a program can take advantage of any sound card with no problems. If the abstraction is leaky, however, the program may run into trouble - the sound may come out differently depending on the sound card, requiring the program to compensate by incorporating logic specific to the sound card installed in the computer.
Any API which behaves differently depending on the underlying implementation is considered leaky. If a program fails to compensate for leaky APIs, bugs can result.
Obscure error messages are a common observable effect of leaky abstractions in software. A newfangled sound card, for example, may be able to reproduce the same sounds as old sound cards, but it also may have new ways of failing. If the operating system's sound card abstraction didn't anticipate the new failure modes, the program will encounter a failure it couldn't anticipate and can't understand. This can result in an "unknown error" or similar error message being presented to the user.
The software industry comprises businesses involved in the development, maintenance and publication of computer software.
..... Click the link for more information.
Within the software industry, leaky abstractions are a common source of software bugs.
Overview
The term is attributed to software commentator Joel Spolsky, who published the concept asThe Law of Leaky Abstractions:
| All non-trivial abstractions, to some degree, are leaky. |
In the publication, Spolsky expresses this viewpoint, and supports it with reference to examples in software engineering, which is why this term is customarily used in the context of computer software and hardware.
Technical sense
When applying the term to a specific instance, it is a misnomer. The implementation is leaky, not the abstraction. Abstractions are conceptual and are not susceptible to leaks. Abstractions may have other faults, such as ambiguities or contradictions. The term 'leaky abstraction' refers not to faults in the abstraction itself, only to faults in its implementation.Generalized sense
From the perspective of Spolsky's Law of Leaky Abstractions, all non-trivial abstractions resist complete implementation by their very nature. Consequently, implementation details will always leak through, regardless of how well-conceived, and no matter how rigorously they attempt to faithfully represent the abstraction. Sometimes the leaks are minor, other times they are significant, but they will always be present, because there is no such thing as a perfect implementation of an abstraction.In this context, the term isn't a misnomer, since it applies to all implementations of all abstractions.
It is most likely this notion Spolsky intended to convey by expressing the viewpoint as a "law" and attributing the "leakiness" to abstractions, rather than to imprecise implementations.
Philosophical sense
In an epistemological sense, the human concept of any abstraction is always an implementation of deeper abstractions, represented in mental concepts and verbal statements used to convey them. There is no generally agreed-upon deepest layer of abstraction. Much (if not most) of the field of philosophy is predicated upon searching for such a layer.The idea that all sufficiently interesting abstractions are leaky thus has profound philosophical ramifications.
Consider the field of physics. An atom of hydrogen is an abstraction which is implemented, on a deeper level, by a set of quarks. The extent to which the nature of the quarks "leaks" through to the nature of the hydrogen atom appears to depend largely on context such as temperature. However, there's no doubt that the quark implementation leaks through; otherwise, it would not be possible to know about quarks. Humans only know they exist based on the extent to which they leak through higher-level abstractions.
In this way, the Law of Leaky Abstractions is a tautology. Any abstraction that isn't leaky cannot be distinguished from a fundamental truth. A fundamental truth is not properly an abstraction. Ergo, no abstractions are not leaky.
Examples
Monetary value
Paper currency implements the abstract economic concept of monetary value. Conceptually, monetary value cannot be destroyed; yet a paper dollar can be. The physical nature of the implementation (the paper dollar) corrupts the conceptual nature of the abstraction (its monetary value). If a dollar is burned, the value is lost (to its owner, but gained prorata by all dollar owners), even though such a result shouldn't be possible from the perspective of monetary ownership.Computers
Computer hardware and software is heavily reliant on abstraction, and therefore subject to the consequences of leaky abstraction.For example, many different brands of sound card exist, and each has different capabilities and methods of operation. It is the role of the computer's operating system to implement a sound card abstraction for programs, so that a program need not have knowledge about every possible sound card that may be present. The program tells the operating system's sound card abstraction what sound to make, and the operating system then tells the sound card to make the sound using the mechanisms and capabilities unique to that sound card. If the abstraction isn't leaky, then a program can take advantage of any sound card with no problems. If the abstraction is leaky, however, the program may run into trouble - the sound may come out differently depending on the sound card, requiring the program to compensate by incorporating logic specific to the sound card installed in the computer.
Any API which behaves differently depending on the underlying implementation is considered leaky. If a program fails to compensate for leaky APIs, bugs can result.
Obscure error messages are a common observable effect of leaky abstractions in software. A newfangled sound card, for example, may be able to reproduce the same sounds as old sound cards, but it also may have new ways of failing. If the operating system's sound card abstraction didn't anticipate the new failure modes, the program will encounter a failure it couldn't anticipate and can't understand. This can result in an "unknown error" or similar error message being presented to the user.
See also
External links
- The Law of Leaky Abstractions - the original article by Joel Spolsky, who coined the term
- Joel on API Apology - see Bram Cohen's response to Joel.
- Coding Horror: Respecting Abstraction - an article about abstractions by Jeff Atwood
Notes
Implementation is the realization of an application, or execution of a plan, idea, model, design, specification, standard, algorithm, or policy.
In computer science, an implementation is a realization of a technical specification or algorithm as a program, software
..... Click the link for more information.
In computer science, an implementation is a realization of a technical specification or algorithm as a program, software
..... Click the link for more information.
Abstraction is the process of generalization by reducing the information content of a concept or an observable phenomenon, typically in order to retain only information which is relevant for a particular purpose.
..... Click the link for more information.
..... Click the link for more information.
worldwide view of the subject.
Please [ improve this article] or discuss the issue on the talk page.
Please [ improve this article] or discuss the issue on the talk page.
The software industry comprises businesses involved in the development, maintenance and publication of computer software.
..... Click the link for more information.
A software bug (or just "bug") is an error, flaw, mistake, failure, or fault in a computer program that prevents it from behaving as intended (e.g., producing an incorrect result).
..... Click the link for more information.
..... Click the link for more information.
Joel Spolsky (born 1965) is a software engineer and writer. He is the author of Joel on Software, a blog on software development targeted mainly at writers of Windows software.
..... Click the link for more information.
..... Click the link for more information.
Software engineering is the application of a systematic, disciplined, quantifiable approach to the development, operation, and maintenance of software.[1] The term software engineering
..... Click the link for more information.
..... Click the link for more information.
This article or section may contain original research or unverified claims.
..... Click the link for more information.
Please help Wikipedia by adding references. See the for details.
This article has been tagged since September 2007.
This article has been tagged since September 2007.
..... Click the link for more information.
Epistemology or theory of knowledge is the branch of philosophy that studies the nature, methods, limitations, and validity of knowledge and belief.
The term "epistemology" is based on the Greek words "
..... Click the link for more information.
The term "epistemology" is based on the Greek words "
..... Click the link for more information.
Physics is the science of matter[1] and its motion[2][3], as well as space and time[4][5] —the science that deals with concepts such as force, energy, mass, and charge.
..... Click the link for more information.
..... Click the link for more information.
In propositional logic, a tautology (from the Greek word ταυτολογία) is a sentence that is true in every valuation (also called interpretation) of its propositional variables, independent of the truth values assigned to these
..... Click the link for more information.
..... Click the link for more information.
economy is the system of human activities related to the production, distribution, exchange, and consumption of goods and services of a country or other area.
The composition of a given economy is inseparable from technological evolution, civilization's history and social
..... Click the link for more information.
The composition of a given economy is inseparable from technological evolution, civilization's history and social
..... Click the link for more information.
Hardware is a general term that refers to the physical artifacts of a technology.It may also mean the physical components of a computer system.
Hardware historically meant the metal parts and fittings that were used to make wooden products stronger, more functional, longer
..... Click the link for more information.
Hardware historically meant the metal parts and fittings that were used to make wooden products stronger, more functional, longer
..... Click the link for more information.
Computer software is a general term used to describe a collection of computer programs, procedures and documentation that perform some task on a computer system. [1]
..... Click the link for more information.
..... Click the link for more information.
Sound Card
A Sound Blaster Live! Value card, a typical present-day PCI sound card
Connects to:
..... Click the link for more information.
A Sound Blaster Live! Value card, a typical present-day PCI sound card
Connects to:
- Motherboard via one of
..... Click the link for more information.
computer is a machine which manipulates data according to a list of instructions.
Computers take numerous physical forms. The first devices that resemble modern computers date to the mid-20th century (around 1940 - 1941), although the computer concept and various machines
..... Click the link for more information.
Computers take numerous physical forms. The first devices that resemble modern computers date to the mid-20th century (around 1940 - 1941), although the computer concept and various machines
..... Click the link for more information.
An operating system (OS) is the software that manages the sharing of the resources of a computer. An operating system processes system data and user input, and responds by allocating and managing tasks and internal system resources as a service to users and programs of the
..... Click the link for more information.
..... Click the link for more information.
An application programming interface (API) is a source code interface that an operating system or library provides to support requests for services to be made of it by computer programs.
..... Click the link for more information.
..... Click the link for more information.
An error message is a message displayed when an unexpected condition occurs, usually on a computer or other device. Error messages are often displayed using dialog boxes. Error messages are used when user intervention is required, indicate that a desired operation has failed, or
..... Click the link for more information.
..... Click the link for more information.
Failure modes are characterizations of the ways a product or process can fail.
Rather than the simple description of symptoms that many product users or process participants might use, the term failure mode refers to a rather complete description, including the
..... Click the link for more information.
Rather than the simple description of symptoms that many product users or process participants might use, the term failure mode refers to a rather complete description, including the
..... Click the link for more information.
In computer programming, abstraction inversion is an anti-pattern arising when the interface to a construct does not expose the functions needed by its users, although they are used within the construct.
..... Click the link for more information.
..... Click the link for more information.
Joel Spolsky (born 1965) is a software engineer and writer. He is the author of Joel on Software, a blog on software development targeted mainly at writers of Windows software.
..... Click the link for more information.
..... Click the link for more information.
Bram Cohen (born 1975) is an American computer programmer, best known as the author of the peer-to-peer (P2P) protocol BitTorrent, as well as the first file sharing program to use the protocol.
..... Click the link for more information.
..... Click the link for more information.
This article is copied from an article on Wikipedia.org - the free encyclopedia created and edited by online user community. The text was not checked or edited by anyone on our staff. Although the vast majority of the wikipedia encyclopedia articles provide accurate and timely information please do not assume the accuracy of any particular article. This article is distributed under the terms of GNU Free Documentation License.
Herod_Archelaus