What’s glue code?

Print anything with Printful



Glue code connects incompatible software components, allowing one piece of code to call functions in another or pass small data values. It can link code modules of any size, but may have significant overhead. Glue code is different from XML, which annotates data while glue code allows for data movement and manipulation.

Glue code is computer code that joins together programs or software components that would otherwise not be compatible. This code does not usually serve a purpose such as computation or computation, but only serves as a proxy between two incompatible pieces of software. Object-oriented programming languages ​​can be linked with scripting languages, two object-oriented languages ​​can be linked together, or large parts of the same language can be joined by this code.

Although the glue code can be used to transfer information between computer languages, it is not required to do so. Typically, it allows one piece of code to call functions in the other, or allows small data values ​​to be passed between blocks of code. Some code generators allow user-specified data structures to be passed between code modules, but not all do. Moving large amounts of data through the connect code may not always be reliable.

The glue code generated, especially when linking distinct computer languages, often contains pieces of code specific to each connected module of code. For example, to connect C++ with Java, the generated code can include both a C++ file and a Java file. As long as no breaking changes are made to the structures of the linked code modules, there is no need to modify the generated files, but they may need to be updated during development. Generated files like these rarely need to be modified or maintained by a developer and never by an end user.

Glue code can be used to link code modules of any size, from small functions to large libraries. Depending on the amount of proxy code generated for this purpose, there may be a significant amount of code overhead and overhead, so linking small pieces of code in this way may not always be ideal. When synchronizing calls to large libraries or merging large code repositories, on the other hand, a small amount of this type of code can be a valuable way to bring functionality where it might not otherwise be available.

Extensible Markup Language (XML) data is sometimes mistaken for glue code, but the purpose of each is quite different. XML is a markup language, meaning it adds organizational and descriptive information to existing data to make it easier to interpret. Both can act as a proxy to move information around, but XML is static and much more limited in terms of the data it can transfer between blocks of code. XML annotates and classifies data, while glue code allows for data movement and manipulation.




Protect your devices with Threat Protection by NordVPN


Skip to content