What is a Shim?

Asked

Viewed 762 times

5

When asking about "what is a Polyfill?", bumped between comments and searches with the term Shim.

  • What would be a Shim?

  • What is the relation of the term Shim with the term polyfill?

  • Shim is directly connected to Javascript, as well as Polyfill?

1 answer

4

Seeking to contribute proactively, and also respecting the answers in English: [What is a Shim? - En, 2010]. I intend to answer in a simple and objective way. So we have the following concept of Shim:

Shim Infrastructure implements a form of hooking application programming interface (API). Specifically, it leverages the nature of the link to redirect Windows' own API calls to alternate code - Shim himself. [Technet Microsoft, 2011]


At first, we believe that this is just another concept, but considering:

Microsoft Windows application compatibility infrastructure (Shim Infrastructure) is one of these powerful technical solutions [see well: is one of these powerful technical solutions]. As the Windows operating system evolves from version to version change to support new technology, incorporate bug fixes and implement a strategy modification - changes in the implementation of some functions may affect applications that depend on them. [Technet Microsoft, 2011]

If we consider the idea of hooks (hooking) to modify the behavior of API’s and thus improve, with new technologies, or fix bugs if of powerful technical solutions when implementing regression Features for old applications (or in the case of Polyfill: old browsers [Stack Overflow - a, 2017]). To illustrate see the following figure:

Shim

Of course, the use of Shim Infrastructure is justified:

To reduce deployment costs and accelerate adoption, [...] to ensure broad compatibility of existing software, leading to compatibility to the engineering and release process. [Technet Microsoft, 2011]

With the explanation above, I hope I have answered: What would be a Shim?.


Now, What is the relation of the term Shim to the term polyfill? We can consider again the quote, the polyfill is:

A Shim that mimics a future API providing return functionality for older browsers. [Paul Irish]

So, the Shim Vs polyfill ratio, is that polyfill - is a Shim in context (if, only if) where the application is an improved antido browser. In case the application is a browser, then we use polyfill technical jargon.


And finally: Shim is directly connected to Javascript, as is Polyfill?

We can categorize that Shim is in a larger scope, that is, for any application we are implementing API hooks, even for a browser, we are practicing Shim technical solutions. So we can say that Shim is not directly connected to Javascript, as well, even Polyfill is not directly linked to javascript because we have other languages that implement browser-related functionality.


Reference:
[What is a Shim? - En, 2010], Available at: Stack Overflow Site in English. Accessed: 8 Apr, 2017
[Microsoft Technet, 2011], Available in: Website Technet Microsoft. Accessed: 8 Apr, 2017
[Stack Overflow - a, 2017], Available in: Stack Overflow: What is Polyfill?. Accessed: 8 Apr, 2017
[Paul Irish]. Available in personal site. Accessed: 8 Apr, 2017.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.