Glue code

From Wikipedia, the free encyclopedia

In programming, glue code is code that does not compute anything functional towards meeting the program's requirements, but instead serves solely to "glue together" different parts of code that would otherwise not be compatible. Glue code often appears in code written to let existing libraries or programs interoperate, such as in foreign function interfaces like the Java native interface.


Glue code provides functionality to combine different components

Purposes of glue code include:

  • Control flow: Invokes functionality of the underlying components as required
  • Component bridge: Glue code can resolve any interface incompatibilities between components, for example by performing any necessary data conversions (mediator)
  • Exception handling: By trapping exceptions the glue code can provide a consistent exception handling mechanism

[source?]




[edit] See also