User Tools

Site Tools


This is an old revision of the document!

Des Rivières, J. Evolving Java-based APIs. 2007


This document is about how to evolve Java-based APIs while maintaining compatibility with existing client code.


Yann-Gaël Guéhéneuc, 2014/02/06

This document is very interesting because it tells all about Java-based API evolution in one document (okay, in three separate pages) without wasting space but going straight to the point. It starts by defining some basic concepts, such as Component, Component API, and Client and different levels of compatibility between an old and a new version of the Component API wrt. Clients:

  1. Contract compatibility: API changes must not invalidate formerly legal Client binaries;
  2. Source code compatibility: API changes must not prevent Client code to compile against the new release of the Component;
  3. Binary code compatibility: pre-existing Client binaries must link and run with the new release of the Component without recompiling;
  4. Data compatibility: Component new implementation must contain readers for current and all past versions of the data format.

The document emphasises that source code compatibility is not necessary, because it argues that most API changes can be caught by the compiler and corrected by the developers. It is correct if the documentation regarding the transition between old and new API is sufficiently explicit for developers to easily find how to change their code.

evolving_java-based_apis.1391670029.txt.gz · Last modified: 2018/03/04 02:53 (external edit)