Skip to content
AyoKoding

Overview

You have finished the by-example tracks for both DDD and Hexagonal Architecture. You know what an aggregate is. You know what a port is. Now the question is: how do they wire together in a real production codebase that ships? This section answers that question through two parallel tracks against the same shared Procure-to-Pay domain — so the only thing that changes between tracks is the language and framework.

What's in this section

Two production-wiring tracks, both running against the hypothetical procurement-platform-be service (Purchase Requisitions → POs → Goods Receipt → Three-Way Matching → Payment):

Both tracks share the same 27-guide numbering (beginner 1–6/7, intermediate 8–14/15, advanced 15/16–22, production 23–27) so cross-track comparison is trivial: Guide 5's F# port definition versus Guide 5's Java interface definition is a single side-by-side read.

Prerequisites

Complete the by-example tracks before starting either in-the-field track:

The in-the-field tracks use terms like aggregate, port, adapter, bounded context, and repository pattern without redefinition. If any feel unfamiliar, finish the prerequisite track first.

Running domain — Procure-to-Pay procurement platform

Both tracks reason against the same hypothetical service: procurement-platform-be, the backend of a Procure-to-Pay (P2P) procurement platform.

Bounded contextAggregate rootResponsibility
purchasingPurchaseRequisition, PurchaseOrderRequisition lifecycle, approval routing, PO issuance
supplierSupplierVendor master, approval state, risk score
receivingGoodsReceiptNoteGoods receipt against PO, quantity verification
invoicingInvoiceInvoice registration, three-way matching (PO ↔ GRN ↔ Invoice)
paymentsPaymentPayment run scheduling, bank disbursement
murabaha-financeMurabahaContract (optional Sharia tier)Bank-purchased asset, markup contract, repayment schedule

Same contexts, same aggregates, same domain events, same ports across both tracks — only the language and framework idioms differ.

Why two parallel tracks

Comparing the F# wiring of Guide 5 (a port as a function type alias) against the Java wiring of Guide 5 (a port as an interface) against the same business problem is the fastest way to internalise the structural decisions that hexagonal architecture and DDD demand — regardless of which paradigm you ultimately ship with.

Last updated May 16, 2026

Command Palette

Search for a command to run...