Reference articles on history, science, culture and more
Encyclopedia

Glue code

Source code that serves solely to "adapt" different parts of code

In computer programming, glue code is code that allows components to interoperate that otherwise are incompatible. The adapter pattern describes glue code as a software design pattern.

Glue code describes language bindings or foreign function interfaces such as the Java Native Interface (JNI).

Glue code may be written to access existing libraries, map objects to a database using object-relational mapping, or integrate commercial off-the-shelf programs.

Glue code may be written in the same language as the code it is gluing together, or in a separate glue language.

Glue code can be key to rapid prototyping.

Watch videos about Glue codeExplainers and documentaries on YouTube (opens in a new tab)

Sources and credits

This article is adapted from the Wikipedia article Glue code, written by its contributors and licensed under CC BY-SA 4.0. Fathomly has changed the layout, removed citation markers, navigation and maintenance notices, and adjusted punctuation. This adapted version is shared under the same license. For references, see the original article.

Fathomly is not affiliated with or endorsed by the Wikimedia Foundation. Spotted a problem? Tell us.