liveBook · Manning

Elapsed days

As explained in Data-Oriented Programming in Java

Elapsed days are the count of complete days that have passed since a relevant starting point.

Elapsed days describe a count of complete days from a relevant starting point, but the unit needs domain clarification before becoming a Java field. In drying-oil measurements, observations are sparse: days 1, 3, 4, and 7 do not imply missing data. They reflect the way measurements were designed. section 3.1

Model elapsed days with explicit constraints:

  • Allow zero and positive integers; negative values contradict the domain meaning. section 3.3.2
  • Do not assume consecutive daily observations; sparse sequences are valid. section 3.1
  • Replace a broad int with a constrained NonNegativeInt value in the Measurement record. section 3.3.2

Drying-oil measurements

A measurement such as {"sampleId":"UV-1", "day":3, "contactAngle":17.4} records an observation three days into the process. A later value of 10 is not evidence that days 4–9 were omitted; observations were intentionally performed only every few days. section 3.1

Listing 3.4 Writing down our understanding of daysElapsed
                     Domain Notes.md
=========================================================
SampleID: Unknown
 
Days Elapsed: 
    A positive integer (0 inclusive). 
    Not strictly daily. Will be Sparse. 

Contact Angle: Unknown

Use the domain notes to preserve the key invariant: elapsed days are non-negative and need not form a daily sequence. section 3.1

How Data-Oriented Programming in Java covers it

How deep it goes
Derives sparse-observation semantics and a non-negative constraint, then stops short of defining calendar or timestamp behavior.
Examples
Uses drying-oil contact-angle JSON, sparse day sequences, domain notes, and Java Measurement records.
What it assumes
Assumes basic Java numeric types and records, while deriving the field’s meaning from measurement behavior.
What you can do after
Apply domain investigation to model elapsed days with an explicit non-negative type and avoid treating sparse observations as missing data.
How it connects
Connects elapsed days with domain modeling, measurement data, contact angle, and type-system constraints.

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.