'. '

ProviderAPI

From APIDesign

Revision as of 21:35, 7 March 2011 by JaroslavTulach (Talk | contribs)
Jump to: navigation, search

Rules for extending API designed for implementors are very different to those for API that can only be called. In case you have a provider implementing your interface, the obvious expectation of that person seems to be that the once the implementation is written, (potentially) compiled once, it will continue to work forever.

One can visualize such provider interface as a fixed point. As a point which stays the same, does not grow (adding a new method to implement would put additional, unsatisfiable requirements on existing implementors). If the fixed point changes, then only minimaly. It can shrink - e.g. in future version the API infrastructure may decide to not call some of the methods so often. Or it can start receiving different arguments (instead of array of size 1024 bytes, one may obtain calls with 4096 bytes array). Of course only if the specification was not strict about the order of calls, or size of the parameters...

The easiest way to break this promise is to add new non-implemented methods into the type. As such do not add new methods to interfaces or abstract classes implemented by some providers. This immediately breaks the promise of source BackwardCompatibility.

TBD: Fragile methods additions

TBD: Interfaces and clear definition of a version

Personal tools
buy