liveBook · Manning

Evidence

As explained in Data-Oriented Programming in Java

Evidence is information that demonstrates that a required data condition or capability has been established.

Evidence is information that demonstrates a required data condition or capability has been established. Validation should produce evidence of safe preconditions, not merely report invalid inputs. section 9.3.3

Evidence-oriented validation makes important domain knowledge explicit:

  • Constructs a data type only after required external data has been loaded and assembled. section 9.3.3
  • Separates acquiring data from using it, preventing later work from depending on hidden or fractured state. section 9.3.3
  • Uses types to create positive design pressure: anyone constructing the type must handle the important conditions first. section 9.3.3

Turning a raw request into evidence

A raw AddItemsRequest becomes a ValidAddItemsRequest only after validation, product details, pricing, inventory, and related data have been loaded. The resulting type records what is safe to assume.

How Data-Oriented Programming in Java covers it

How deep it goes
Defines evidence through records and loading steps, while leaving the validation implementation interchangeable.
Examples
Uses AddItemsRequest, ValidAddItemsRequest, Item, pricing data, inventory counts, and product details.
What it assumes
Assumes familiarity with raw requests and external services, while teaching precondition-oriented validation from those inputs.
What you can do after
Build it from scratch by converting raw inputs into types that encode validated preconditions.
How it connects
Connects validation, data loading, preconditions, domain modeling, and type-driven design.

Also explained in

Compare how 8 books explain evidence →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data-Oriented Programming in Java. The section links point to the parts of the book it draws on.