Backward Compatibility

From Delft Solutions
Revision as of 19:13, 18 January 2021 by Thexa4 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Backwards Compatibility is the practice of allowing older versions of software to keep working with newer versions of server software.

Strategies

Enabling backwards compatibility usually comes with a tradeoff in other areas. Luckily there are multiple approaches to backwards compatibility that can be used.

Never Introducing a Breaking Change

The simplest way to achieve backwards compatibility is by keeping the protocol exactly the same in newer versions. Unfortunately this also means you cannot easily add new features.

Versioning

Another way is to version the API and introducing a new version whenever you introduce a breaking change. There are multiple ways to implement versioning that have different tradeoffs.

Web Fallback

If you are making client software that is meant to be used by interactive users you can redirect them to a web version of your app. For example by building the ability to show a webpage into the client if the server detects the client is too old. If you are using Content Negotiation you can implement this by accepting the `text/html` Media Type and opening a browser window in response.