Abstraction inversion

Source: Wikipedia, the free encyclopedia.

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:

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

External links

  • Abstraction Inversion at Portland Pattern Repository - extensive discussion, much of it taking "abstraction inversion" in the sense of "concealed complexity"