liveBook · Manning

Expression-oriented shape

As explained in Data-Oriented Programming in Java

An organization of method internals around expressions that evaluate to returned values rather than primarily around imperative assignments.

An expression-oriented shape organizes method internals around expressions that evaluate to returned values, rather than around imperative statements and assignments. It makes inputs, outputs, and business meaning visible at the method boundary. section 1.4

Rescheduling a failed task

A vague void method such as reschedule() hides its behavior inside mutable state. A data-oriented alternative accepts a FailedTask and returns a RetryDecision. A switch expression can then produce RetryImmediately, ReattemptLater, or Abandoned values for explicit conditions.

How Data-Oriented Programming in Java covers it

How deep it goes
Explains the shift from imperative assignments to returned expressions through a scheduling refactoring, without detailing runtime internals.
Examples
Uses scheduler rescheduling, FailedTask inputs, RetryDecision results, and retry outcome types as concrete examples.
What it assumes
Assumes familiarity with method signatures and interfaces while demonstrating how data shapes can guide implementation choices.
What you can do after
Apply it by refactoring ambiguous void methods into functions with explicit data inputs and value-producing results.
How it connects
Connects data-oriented programming with method signatures, pattern matching, sealed classes, and explicit domain types.

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.