A pipeline is a sequence of processing stages in which each output becomes the next stage’s input. Designing the stages as data transformations makes requirements visible before implementation begins. section 5.3.2
A practical pipeline design proceeds by:
- Matching representative inputs to outputs and refining the resulting flow until the major requirements form a readable narrative. section 5.3.2
- Representing runtime alternatives as explicit data types, such as sealed decisions with separate record variants. section 5.3.2
- Turning each transformation into a method only after the high-level stages and branches are clear. section 5.3.2
Late-fee pipeline
A late-fee process can flow from List<Invoice> to List<PastDue>, then LateFeeDraft, then one of BillableFee, NotBillable, or NeedsApproval. BillableFee produces BilledLateFee or RejectedLateFee; NeedsApproval produces ApprovalStarted; NotBillable produces RejectedLateFee. section 5.3.2
Listing 5.19 A narrative designed for human consumption
// step 1: collect the past due List<Invoice> -> List<PastDue> // Step 2: use those to build the draft List<PastDue> -> LateFeeDraft // Step 3: decide what to do with the draft LateFeeDraft -> (BillableFee OR NotBillable OR NeedsApproval // then depending on what we decided, either: // Step 4.1: submit billable items BillableFee -> (BilledLateFee OR RejectedLateFee) // OR Step 4.2: Start the approval process for those that need it NeedsApproval -> ApprovalStarted // OR Step 4.3: keep the non billable data for posterity NotBillable -> RejectedLateFee
This listing shows a pipeline as a human-readable sequence of transformations and branch outcomes before those steps become Java methods. section 5.3.2






























































