Glue code: Difference between revisions

Content deleted Content added
m Nohing
Glue code definitely can contribute to meeting requirements; remove consequences since not cited, poorly written and of questionable value
 
(32 intermediate revisions by 19 users not shown)
Line 1:
{{short description|Source code that serves solely to "adapt" different parts of code}}
{{Multiple issues|
{{more footnotes|date=June 2016}}
{{copy edit|date=June 2016}}
}}
 
In [[computer programming]], '''glue code''' is [[source code|code]] that allows components to [[Interoperability#Software|interoperate]] that otherwise are [[Software incompatibility|incompatible]]. The [[adapter pattern]] describes glue code as a [[software design pattern]].
In [[computer programming]], '''glue code''' is a [[source code]] that serves solely to "adapt" different parts of code that would otherwise be incompatible. It does not contribute any function towards meeting the program's [[requirement]]s, but instead glue code often appears in code written to let existing [[Library (computing)|libraries]] or programs [[Interoperability#Software|interoperate]], as in [[language binding]]s or [[foreign function interface]]s like the [[Java native interface]], or when mapping [[Object (computing science)|objects]] to a [[database]] using [[object-relational mapping]], or when [[Systems integration|integrating]] two or more [[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 is very efficient in [[rapid prototyping]] environments where several components are quickly put together into a single language or framework.
 
Glue code describes [[language binding]]s or [[foreign function interface]]s such as the [[Java Native Interface]] (JNI).
==Consequences==
Because each component is independent (i.e. it is unaware of its relations and is only connected to another component through glue code), the behavior of a component and its interactions can change during the execution of the script. In addition, a different version of one of the components may behave differently, breaking the glue code.
 
Glue code may be written to access existing [[Library (computing)|libraries]], map [[Object (computer science)|objects]] to a [[database]] using [[object-relational mapping]], or [[Systems integration|integrate]] [[commercial off-the-shelf]] programs.
High-level programming languages can suffer from performance penalties because glue code must run through the language interpreter, even when connecting high-performance subsystems. If performance is crucial, using configuration scripting is often preferred to directly connecting binary interfaces of components. In object-oriented scripting languages, glue code often eliminates the need for class hierarchies and large numbers of classes.
 
Glue code may be written in the same language as the code it is gluing together, or in a separate [[glue language]].
==...==
 
*[[Adaptor pattern]]
Glue code can be key to [[rapid prototyping]].
*[[Scripting language]]
 
*[[Shell script]]
==See also==
*[[SWIG]]
* [[AdaptorAdapter pattern]]
*[[Lua (programming language)]]
* [[GlueScripting logiclanguage]]
* [[WinGlueShell script]]
* [[Wrapper functionSWIG]]
* [[ScriptingLua (programming language)]]
*[[Wrapper library]]
* [[Glue logic]]
* [[WinGlue]]
* [[Wrapper function]]
* [[Wrapper library]]
* [[Method stub]]
 
==References==
{{reflist}}
#* {{cite web |url= http://projects.camlcity.org/projects/dl/findlib-1.2.1/doc/guide-html/x341.html |series= findlib User's Guide |title= ChpChapter 5. Complex packages: Glue code |author-first= Gerd |author-last= Stolpmann |publisher= Caml City }}
#* {{cite web |url= http://www.doc.ic.ac.uk/~np2/patterns/scripting/glue-code.html |title= Glue Code |series= Patterns |work= Scripting |author-first= Nathaniel |author-last= Pryce |___locationpublisher= [[Department of Computing, Imperial College London|publisher=Department of Computing]], [[Imperial College London]]|url-status=dead |archive-url=https://web.archive.org/web/20170331130516/http://www.doc.ic.ac.uk/%7Enp2/patterns/scripting/glue-code.html |archive-date=2017-03-31}}
* {{cite web |author-first1=Timothy C. |author-last1=Lethbridge |author-first2=Robert |author-last2=Laganière |publisher=[[McGraw Hill]] / [[University of Ottawa]] |date=2001-11-21 |orig-year=Summer 2001 |title=Object Oriented Software Engineering: Practical Software Development using UML and Java |at=Glue Code |url=http://www.site.uottawa.ca:4321/oose/index.html#glue_code |url-status=dead |archive-url=https://web.archive.org/web/20170712055627/http://www.site.uottawa.ca:4321/oose/index.html#glue_code |archive-date=2017-07-12}}
 
 
[[Category:Computer programming]]