What's the term for re-implementing an old API in terms of a newer API
Posted
by
dodgy_coder
on Programmers
See other posts from Programmers
or by dodgy_coder
Published on 2012-06-20T02:32:02Z
Indexed on
2012/06/20
3:23 UTC
Read the original article
Hit count: 471
The reason for doing it is to solve the case when a newer API is no longer backwards compatible with an older API.
To explain, just say that there is an old API v1.0. The maker of this API decides it is broken and works on a new API v1.1 that intentionally breaks compatibility with the old API v1.0. Now, any programs written against the old API cannot be recompiled as-is with the new API.
Then lets say there is a large app written against the old API and the developer doesn't have access to the source code. A solution would be to re-implement a "custom" old API v1.0 in terms of the new API v1.1 calls. So the "custom" v1.0 API is actually keeping the same interface/methods as the v1.0 API but inside its implementation it is actually making calls to the new API v1.1 methods.
So the large app can be then compiled and linked against the "custom" v1.0 API and the new v1.1 API without any major source code changes.
Is there a term for this practice?
There's a recent example of this happening in Jamie Zawinski's port of XScreenSaver to the iPhone - he re-implemented the OpenGL 1.3 API in terms of the OpenGL ES 1.1 API. In this case, OpenGL 1.3 represents the "old" API and OpenGL ES 1.1 represents the "new" API.
© Programmers or respective owner