Shim (computing)
   HOME

TheInfoList



OR:

In
computer programming Computer programming or coding is the composition of sequences of instructions, called computer program, programs, that computers can follow to perform tasks. It involves designing and implementing algorithms, step-by-step specifications of proc ...
, a shim is a
library A library is a collection of Book, books, and possibly other Document, materials and Media (communication), media, that is accessible for use by its members and members of allied institutions. Libraries provide physical (hard copies) or electron ...
that transparently intercepts
API An application programming interface (API) is a connection between computers or between computer programs. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how to build ...
calls and changes the arguments passed, handles the operation itself or redirects the operation elsewhere. Shims can be used to support an old API in a newer environment, or a new API in an older environment. Shims can also be used for running programs on different software platforms than they were developed for. Shims for older APIs typically come about when the behavior of an API changes, thereby causing compatibility issues for older applications which still rely on the older functionality; in such cases, the older API can still be supported by a thin
compatibility layer In software engineering, a compatibility layer is an interface that allows binaries for a legacy or foreign system to run on a host system. This translates system calls for the foreign system into native system calls for the host system. With s ...
on top of the newer code. Shims for newer APIs are defined as: "a
library A library is a collection of Book, books, and possibly other Document, materials and Media (communication), media, that is accessible for use by its members and members of allied institutions. Libraries provide physical (hard copies) or electron ...
that brings a new API to an older environment, using only the means of that environment."


Examples

* Web polyfills implement newer web standards using older standards and
JavaScript JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior. Web browsers have ...
, if the newer standard is not available in a given
web browser A web browser, often shortened to browser, is an application for accessing websites. When a user requests a web page from a particular website, the browser retrieves its files from a web server and then displays the page on the user's scr ...
. * Support of
AppleTalk AppleTalk is a discontinued proprietary suite of networking protocols developed by Apple Computer for their Macintosh computers. AppleTalk includes a number of features that allow local area networks to be connected with no prior setup or the ...
on
Macintosh Mac is a brand of personal computers designed and marketed by Apple Inc., Apple since 1984. The name is short for Macintosh (its official name until 1999), a reference to the McIntosh (apple), McIntosh apple. The current product lineup inclu ...
computers, during the brief period in which
Apple Computer Apple Inc. is an American multinational corporation and technology company headquartered in Cupertino, California, in Silicon Valley. It is best known for its consumer electronics, software, and services. Founded in 1976 as Apple Computer Co ...
supported the Open Transport networking system. Thousands of Mac programs were based on the AppleTalk protocol; to support these programs, AppleTalk was re-implemented as an OpenTransport "stack", and then re-implemented as an API shim on top of this new library. * The
Microsoft Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
Application Compatibility Toolkit (ACT) uses the term to mean
backward compatible In telecommunications and computing, backward compatibility (or backwards compatibility) is a property of an operating system, software, real-world product, or technology that allows for interoperability with an older legacy system, or with inpu ...
libraries. Shims simulate the behavior of older versions of Windows for legacy applications that rely on incorrect or deprecated functionality, or correct the way in which poorly written applications call unchanged APIs, for example to fix least-privileged user account (LUA) bugs. * bind.so is a shim library for
Linux Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
that allows any application, regardless of permissions, to bind to a listening socket or specify outgoing IP address. It uses the
LD_PRELOAD In computing, a dynamic linker is the part of an operating system that loads and links the shared libraries needed by an executable when it is executed (at " run time"), by copying the content of libraries from persistent storage to RAM, fill ...
mechanism, which allows shims and other libraries to be loaded into any program. * In the ''type tunnel'' pattern, a generic interface layer uses a family of shims to translate a heterogeneous set of types to a single primitive type used by an underlying API.


See also

*
Adapter pattern In software engineering, the adapter pattern is a software design pattern (also known as wrapper, an alternative naming shared with the decorator pattern) that allows the interface of an existing class to be used as another interface. It is oft ...
*
Application virtualization Application virtualization is a software technology that encapsulates computer programs from the underlying operating system on which they are executed. A fully virtualized application is not installed in the traditional sense, although it is sti ...
*
Driver wrapper A driver wrapper is a subroutine in a software library that functions as an adapter between an operating system and a driver, such as a device driver, that was not designed for that operating system.https://www.ijert.org/research/device-driver-wr ...
*
Glide wrapper Glide is a 3D graphics API developed by 3dfx Interactive for their ''Voodoo Graphics'' 3D accelerator cards. It started as a proprietary API, and was later open sourced by 3dfx. It was dedicated to rendering performance, supporting geometry an ...
*
Glue 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 ...
* Stub (computer science) * Thunk (compatibility mapping) * Windows on Windows (WoW) *
Wrapper function A wrapper function is a function (another word for a ''subroutine'') in a software library or a computer program whose main purpose is to call a second subroutine or a system call with little or no additional computation. Wrapper functions sim ...
* Wrapper library


References

{{reflist, 30em


External links


Microsoft Dev-Center - Windows 8 Client and Server 2012 application Compatibility

Microsoft TechNet - Understanding Shims
Application programming interfaces Compatibility layers