Computer Science – Difference Between Layer of Abstraction and Level of Indirection

computer scienceterminology

I am not sure if both terms can be used interchangeably. Maybe there is some academic distinction in computer science which is not relevant for day-to-day programming? Or can I use both term interchangeably without being wrong? Maybe it depends on the context in which I use both terms?

Edit: On reason why I find both terms possibly interchangeable is a Wikipedia entry about Abstraction layer. There you can find David Wheelers quote 'All problems in computer science can be solved by another level of indirection.'

Best Answer

Abstraction deals with simplification, indirection deals with location.

  • Abstraction is a mechanism that "hides" complicated details of a object in terms of simpler, easier to manipulate terms. In programming, a good example is the difference in details between machine code and the various tools for creating applications that are ultimately based on machine code. Consider creating a Windows Form application with the Visual Studio IDE. The IDE lets you think of the application in terms of easy-to-manipulate items in a What-You-See-Is-What-You-Get manner. The position of a screen widget is abstracted out to a visual location in a frame which you can change by dragging the widget around. Internally, the IDE manipulates the widget using another layer of abstraction such as a high level language (such as C#). C# itself is not manipulated using machine code, it is manipulated using a "Common Runtime Environment" which itself is an abstraction of a computer and operating system.

  • Indirection refers to making the location of an item transparent. If you know a web resource's URI, you can access the resource without knowing its precise location. You do not access the resource directly, instead you access through a channel that passes your request through a series of servers, applications and routers. Indirection may be considered to be a special type of abstraction where the location is abstracted.