Migrating Callers to a Changed Contract

A change in an interface may require callers to revise assumptions about input, result meaning, or discarded effects.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. Trace an optional field
  2. Avoid relying only on signature changes

Trace an optional field

Returning a missing value instead of zero changes consumers that sum it directly. Provide a deliberate transition and verify callers under both supported behaviors when applicable. See versioning function contracts.

Avoid relying only on signature changes

An unchanged type can still have a changed interpretation. Add examples for the old and new semantics. Checking stage boundaries helps confirm the workflow after migration.[1]

References

  1. David L. Parnas, On the Criteria to Be Used in Decomposing Systems into Modules, CMU-CS-71-101 ↩