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:

Abstraction inversion in practice

Ways to avoid this anti-pattern include:

For designers of lower-level software:
  • If your system offers formally equivalent functions, choose carefully which to implement in terms of the other.
  • Do not force unnecessarily weak constructs on your users.
For implementers of higher-level software:
  • Choose your infrastructure carefully.

Examples

Alleged examples from professional programming circles include:

Examples that are common outside professional programming circles include:

See also

References

  1. Critique of DIN Kernel Lisp Definition Version 1.2, footnote 2 - 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. Distribute those centralized microkernels in The Network Hardware Is the Operating System (Francisco J. Ballesteros and Luis L. Fernandez, 1997) suggests that ill-designed microkernels offer simple abstractions with heavyweight implementations, and that this may be called an "abstraction inversion".
  6. The article 'Microkernel' at tunes.org gives many of the arguments against microkernels and suggests that it is an abstraction inversion to implement a modular high-level design using a low-level module manager.
  7. sourcefrog : Tom Lord on Subversion

External links

This article is issued from Wikipedia - version of the 10/15/2015. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.