What a Calling Contract Adds Beyond Parameter Types

Types help describe supported representations. A contract also identifies legitimate values, effects, and outcomes relevant to another component.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. Trace two timestamps
  2. Use concrete cases

Trace two timestamps

Two datetime values may represent deadline and creation time. Their shared type alone cannot state which may be in the past. See timestamp meaning.

Use concrete cases

Give one value that succeeds and another well-typed value requiring rejection. Preconditions describe the expected distinction.[1]

References

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