Glue code: Difference between revisions

Content deleted Content added
Glue code definitely can contribute to meeting requirements; remove consequences since not cited, poorly written and of questionable value
 
(36 intermediate revisions by 22 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 a [[source code|code]] that servesallows solelycomponents to "adapt"[[Interoperability#Software|interoperate]] differentthat partsotherwise ofare code[[Software thatincompatibility|incompatible]]. wouldThe otherwise[[adapter bepattern]] incompatible.describes Itglue doescode notas contributeknsfojhdijgnseJFUOb'PAJOa [[software design pattern]].
ZDSKN?L
PAVJFNs?L 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]]sjehfsfidshfiuerythfidkbfkh;sd;bihxcbjhlsvriytgUFHCKZDHF 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, UDHFBCKJXNBCKJSZND'OasijR98EWOUJSADZXKDDJKBFUGTBGDHFIASUHdYGUFwhdasBLUYHEJFBDSHFFDor in a separate [[glue language]]. Glue code is very efficient kfbgdiu;o'in [[rapid prototyping]] environments where several components are quickly put together into a single language or frameworkJFHBI;KJDNHFIURWF;EKHadndFHJIU:eahwdkjlSN.
 
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;DHIGTIRHYWU;OEADJ?lkbgfiu;QRHOages 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, 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]].
Glue code can also sometimes sometimes be viewed as a necessary evil due to how easily it can become the weakest link for service level agreements (SLAs) and, if not properly managed, it can become excessively complicated code that can effect performance.
 
Glue code can be key to [[rapid prototyping]].
 
==See also==
* [[AdaptorAdapter pattern]]
* [[Scripting language]]
* [[Shell script]]
* [[SWIG]]
* [[Lua (programming language)]]
* [[GluRHBFGAIYIGFULSJZX,HVFYU3GRLeGlue 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. CompGJBsuyGTAOYSUDFlexComplex 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]]