请输入您要查询的百科知识:

 

词条 Glue code
释义

  1. Consequences

  2. See also

  3. References

{{more footnotes|date=June 2016}}{{Merge to|Glue logic|date=September 2018}}

In computer programming, glue code is executable code (often source code) that serves solely to "adapt" different parts of code that would otherwise be incompatible. Glue code does not contribute any functionality towards meeting program requirements. Instead, it often appears in code that lets existing libraries or programs interoperate, as in language bindings or foreign function interfaces such as the Java native interface, when mapping objects to a database using object-relational mapping, or when 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.

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.

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.

See also

  • Adapter pattern
  • Scripting language
  • Shell script
  • SWIG
  • Lua (programming language)
  • Glue logic
  • WinGlue
  • Wrapper function
  • Wrapper library
  • Stub (computer science)

References

  • {{cite web |url=http://projects.camlcity.org/projects/dl/findlib-1.2.1/doc/guide-html/x341.html |series=findlib User's Guide |title=Chapter 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 |location=Department of Computing |publisher=Imperial College London}}
  • {{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 |dead-url=yes |archive-url=https://web.archive.org/web/20170712055627/http://www.site.uottawa.ca:4321/oose/index.html#glue_code |archive-date=2017-07-12}}
{{compu-prog-stub}}

1 : Computer programming

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/9/30 18:28:20