Chapter 5: Modelling Domain Behaviors
Introduces the chapter’s plan to apply data-oriented modeling to a complex feature within an existing application.
After this chapter you will be able to
- Past-due fee calculation. Describe the basic late-fee task: find customers’ past-due invoices, total their outstanding balances, and create a new invoice with a fee based on a percentage of that total.
- Billing decisions and auditability. Explain why calculating a fee does not automatically mean billing it, and why fee decisions must be persisted.
- Invoice dates and lateness. Explain how payment terms and customer ratings affect when an invoice is due and when it is treated as late.
- Legacy integration landscape. Describe why the feature must work across multiple services and pre-existing systems, and state the simplifying assumptions made about service calls.
- Entity-centered application model. Explain how framework conveniences led the existing application to center on a few identity objects, such as Invoice and Customer, that also serve as database models.
- ORM-friendly modeling concessions. Describe the modeling compromise made when a late-fee invoice might differ from a normal invoice.
- Existing Code Dictating Design. Explain why assembling a feature from available services and entities can leave its requirements and purpose hard to see.
- Misleading Invoice Method Contract. Describe the mismatch between the charging method’s advertised input and the invoices it should actually process, and why its defensive checks are unsafe.
- Behaviors as state transformations. Explain the data-oriented view of behavior as a discrete change from an input state to an output state, including for actions such as calling an API.
- Designing behavioral data stages. Describe how modeling a domain behavior involves inventing data for its states and deciding which transformations are needed, using the invoice-to-late-fee example.
- Data Types as Story. Explain how a sequence of input and output data types communicates the late-fee workflow without specifying how each transformation is implemented. Describe why the sequence must distinguish past-due invoices from invoices in general.
- Draft Invoice Lifecycle. Describe why the fee invoice is modeled as a Draft before it becomes an official Open invoice, and why that intermediate state belongs in the data-type story.
- Decisions About Drafts. Explain why the story cannot say that every Draft becomes a late-fee invoice, and describe the three possible decisions the section identifies.
- Decisions as compile time data. Explain how a decision normally made with runtime if/else can instead be represented algebraically as data, separating the decision from any action taken on it.
- Visible late fee outcomes. Describe how making branches explicit corrected the proposed endpoint of the late-fee story: drafts have three possible buckets, only one leads toward a LateFeeInvoice, and the eventual late fee may be billed or not billed.
- Behavior Aligned Data Representations. Explain why a data type must not only be semantically clear but also fit the behaviors being modeled, and why a representation change calls for checking its effects elsewhere in the system.
- PastDue as informational wrapper. Explain that PastDue represents something known about an Invoice’s state, rather than a separate entity with unique state or new attributes, and that a record provides a lightweight wrapper for expressing it.
- Mutable identity inside data. Explain why wrapping the mutable Invoice does not make it a value, and why the section accepts that compromise rather than requiring an immutable copy.
- Contextual meaning of PastDue. Distinguish PastDue from self-contained types such as NonNegativeInt and Degree: whether an invoice is past due depends on another date and potentially on information outside the invoice.
- Value of an imperfect wrapper. Justify keeping a simple PastDue wrapper despite its semantic imperfections: it preserves and communicates a distinction that would otherwise be implicit after the method that computed it.
- Distinct Lifecycle Data Types. Explain why representing Draft, ApprovalStarted, Billed, and Rejected as separate data types makes lifecycle invariants expressible, and why duplicating their shared fields is unattractive.
- Limits of Shared Field Extraction. Describe why wrapping the common fields in a reusable type reduces duplication but makes it awkward to use late fees collectively, even with a sealed hierarchy.
- Runtime Lifecycle Tradeoff. Explain how factoring out what differs makes late fees easier to use together while moving lifecycle protection from compile-time types into runtime checks.
- Parameterized Late Fee Lifecycle. Explain how making LateFee generic over its lifecycle state retains a common late-fee representation while letting methods require particular states at compile time, and identify the acknowledged readability cost.
- Decisions as Data Types. Describe how the decisions about draft late fees can be represented as data types, some consisting only of a name and others carrying attributes.
- Draft Only Assessment Types. Explain how parameterizing LateFee by lifecycle lets the data model express that Assessments deal with Drafts, not Billed or Rejected late fees.
- Value of explicit domain types. Explain why the author considers the extra data types worthwhile despite concerns about class proliferation and lines of code. Describe how the types make the domain understandable and constrain what must be constructed before a bill can be sent.
- Legacy interaction options. Describe the three options for fitting external concerns into the designed model: fit the code to what already exists, isolate the how from the what, or reshape the existing world. Explain that these options can be combined within one feature.
- Semantic control and refactoring cost. Explain why moving toward reshaping existing code can give greater control over semantics but require more expensive changes, and why day-to-day work calls for a balance.
- Costs of fitting existing dependencies. Explain how extending each method to use existing services, entities, and environmental reads can shift attention away from its intended domain behavior. Use buildDraft to describe why that shift makes code harder to trust and maintain.
- Data fetching boundary. Explain how to refactor a method that reads from an external dependency so it accepts the needed data as an argument while another method fetches it. Describe how repeating this across the feature separates getting data from doing something with it.
- Isolated external reads. Explain why gathering network calls and database reads in one place makes the feature easier to reason about, test, and refactor.
- Data access boundary. Explain how a smart access layer lets a feature use the data it wants rather than inherit the structure of existing services, repositories, and entities.
- Unified customer data. Describe why the section groups payment terms, ratings, and approvals into one logical Customer data type.
- Purpose-built data representations. Explain why data-oriented programming makes it practical to reshape existing code into a model suited to a particular task, and identify the boundary mapping this requires.
- Visible costs and complexity. Explain why the finished model can look like a lot of code without necessarily creating all that complexity, and contrast its visible costs with those of legacy code.
- Visible Requirements Through Data. Explain how focusing on data helps with ambiguous requirements in a messy real-world project.
- Invariant Control Through Data Algebra. Explain what changing the algebra of the data lets developers control.
What it builds on
- Starting from Requirements (chapter 4) · Starting a domain model from requirements.
- Identity is about continuity over time (chapter 2) · The distinction between identities and values.
- Algebraic Data Types (chapter 4) · Supplies earlier experience modeling domain data that the author proposes applying to behaviors.
- Translating into a model (chapter 4) · Earlier practice translating requirements into a data model.
- Modeling Data and Values with Records (chapter 2) · The use of records to model data.
- Things to watch out for with records (Part I): shallow immutability (chapter 2) · Records’ shallow immutability does not make mutable contents immutable.
- Enforce invariants during construction (chapter 3) · The idea that construction can enforce a type’s invariants.
- Representing Sealed Families of Data (chapter 4) · Sealed families of data types.
Section by section
Introduction
Introduces the chapter’s plan to apply data-oriented modeling to a complex feature within an existing application.
5.1 "Encouraging timely payments"
Introduces the late-fee feature, its billing and audit requirements, and the existing system in which it must operate.
- Past-due fee calculation: Describe the basic late-fee task: find customers’ past-due invoices, total their outstanding balances, and create a new invoice with a fee based on a percentage of that total.
Why it matters: This is the basic business task that the later model must represent. - Billing decisions and auditability: Explain why calculating a fee does not automatically mean billing it, and why fee decisions must be persisted.
Why it matters: The feature must account for decisions about fees, not just calculate amounts to bill. - Existing system and service ownership: Describe the existing-system constraints and the decisions this service owns.
Why it matters: It establishes which decisions belong to the feature despite its inherited surroundings.
Key terms: past due, outstanding balances, late fees, manual approval, auditable, persisted, existing application, ORM, service integrations
5.1.1 Invoicing (briefly)
This section explains what an invoice represents, when it is considered late, and why the service cannot finalize it on its own.
- Invoice dates and lateness: Explain how payment terms and customer ratings affect when an invoice is due and when it is treated as late.
Why it matters: The invoice's printed due date alone does not tell the service when to charge late fees. - Invoice purpose and lifecycle: Describe what an invoice records and the two states in its simple lifecycle.
Why it matters: These basic states establish which invoices are still awaiting payment. - External invoice finalization: Explain why an invoice made by this service is not yet a real invoice and what the central billing service does.
Why it matters: Creating invoice data locally is different from issuing a finalized invoice to a customer.
Key terms: invoice date, due date, payment terms, customer's rating, grace period, invoice, open, closed, invoice numbers, central billing service
5.1.2 The Legacy System!
This section establishes the fragmented services and pre-existing systems that the invoicing feature must work with, while simplifying how the services behave.
- Legacy integration landscape: Describe why the feature must work across multiple services and pre-existing systems, and state the simplifying assumptions made about service calls.
Why it matters: The feature has to fit into an existing system rather than an idealized design built from scratch.
Key terms: web services, blocking and synchronous, entities, ORMs, prior decisions
5.1.3 A bunch of prior decisions designed around “free"
The section establishes an entity-centered legacy application whose ORM-friendly modeling choices shape where the new feature must fit.
- Entity-centered application model: Explain how framework conveniences led the existing application to center on a few identity objects, such as Invoice and Customer, that also serve as database models.
Why it matters: This explains why the feature starts from existing entities rather than a freshly chosen model. - ORM-friendly modeling concessions: Describe the modeling compromise made when a late-fee invoice might differ from a normal invoice.
Why it matters: The shortcut shows how persistence convenience can shape the domain representation. - Repositories and service placement: Describe where data access and business logic sit in the existing application.
Why it matters: This identifies the existing places the new feature must interact with.
Key terms: identity objects, Entity, ORM, Late Fee Invoice, normal Invoice, ORMs, enums, nullable fields, canonical representations, Repository
5.2 Modeling domain behaviors around existing code
This section shows how assembling a feature from existing services and entities can hide its business purpose and permit dangerous misuse, then argues for modeling domain behaviors as deliberately as data.
- Existing Code Dictating Design: Explain why assembling a feature from available services and entities can leave its requirements and purpose hard to see.
Why it matters: Recognizing this trap helps you design around what a feature means, rather than just what components are available. - Misleading Invoice Method Contract: Describe the mismatch between the charging method’s advertised input and the invoices it should actually process, and why its defensive checks are unsafe.
Why it matters: When a money-charging method hides its real restrictions, a caller can misuse it with serious consequences. - Behavior Modeling Objective: Explain what the author proposes gaining by applying data-modeling skills to domain behaviors.
Why it matters: It identifies the design aim behind replacing implicit safeguards with behavior that communicates and enforces its intended use.
Key terms: services, entities, requirements, conscious design, Invoice, Late Fee invoices, runtime defenses, business rule, modeling behaviors, modeling data
5.3 Modeling domain behaviors around data
The section presents domain behavior as transformations between data states and keeps the initial model separate from implementation details.
- Behaviors as state transformations: Explain the data-oriented view of behavior as a discrete change from an input state to an output state, including for actions such as calling an API.
Why it matters: This view makes even fleeting actions something you can reason about through their inputs and outputs. - Designing behavioral data stages: Describe how modeling a domain behavior involves inventing data for its states and deciding which transformations are needed, using the invoice-to-late-fee example.
Why it matters: Identifying the data on each side of a transformation gives the behavior a model you can work with. - Provisional types before implementation: Explain why the section names new data types without specifying their contents while designing the behavior model.
Why it matters: Provisional names let you revise the model without first committing to an implementation.
Key terms: behaviors, states, inputs, outputs, machine, raw Invoices, Late Fees, pairs of data, data types, implementation details
5.3.1 Telling a story with data
The section uses a sequence of data types to tell the late-fee story, making past-due invoices, draft invoices, and decisions about drafts visible before implementation.
- Data Types as Story: Explain how a sequence of input and output data types communicates the late-fee workflow without specifying how each transformation is implemented. Describe why the sequence must distinguish past-due invoices from invoices in general.
Why it matters: The data types let readers see the requirement clearly before getting caught up in implementation. - Draft Invoice Lifecycle: Describe why the fee invoice is modeled as a Draft before it becomes an official Open invoice, and why that intermediate state belongs in the data-type story.
Why it matters: An explicit Draft prevents the model from treating a proposed invoice as one that has already been issued. - Decisions About Drafts: Explain why the story cannot say that every Draft becomes a late-fee invoice, and describe the three possible decisions the section identifies.
Why it matters: Making the decision visible lets readers understand the business behavior instead of searching for it in nested conditions.
Key terms: Invoice, LateFee, past due invoices, transformations between data types, Draft, Open, billing system, lifecycle, LateFeeInvoices, billable
5.3.2 Represent runtime decisions as compile time algebraic data types
The section shows how representing decisions as data makes domain branches visible and helps sketch behavior as a sequence of data transformations.
- Decisions as compile time data: Explain how a decision normally made with runtime if/else can instead be represented algebraically as data, separating the decision from any action taken on it.
Why it matters: Making a choice explicit lets you model and handle it separately from the code that acts on it. - Visible late fee outcomes: Describe how making branches explicit corrected the proposed endpoint of the late-fee story: drafts have three possible buckets, only one leads toward a LateFeeInvoice, and the eventual late fee may be billed or not billed.
Why it matters: An explicit model prevents the design from implying that every draft produces a billed invoice. - Data transformation narrative: Describe how refining invented inputs and outputs produces a readable map of requirements, which can then guide a sequence of methods without yet being a working implementation.
Why it matters: A readable data-flow sketch lets you revise the behavior before committing to implementation details.
Key terms: if/else, algebraically, decision itself as data, interpreters, Drafts, LateFeeInvoice, life cycle states, billed, not billed, invented inputs
5.4 Fleshing out the representation
This section explains the tradeoffs involved in turning a sketch of domain data into usable types that support the intended behaviors.
- Behavior Aligned Data Representations: Explain why a data type must not only be semantically clear but also fit the behaviors being modeled, and why a representation change calls for checking its effects elsewhere in the system.
Why it matters: The shape of the data influences both the behavior the code can express and the mistakes it can prevent. - Data Type Ergonomics: Explain why the usability of a data type matters alongside its semantic clarity.
Why it matters: A clear model is less useful if developers find it too awkward to use. - Iterative Design Tradeoffs: Describe why the first representation should be treated as one possible solution rather than the final design.
Why it matters: Revisiting a model gives you a chance to find a better balance among its competing demands.
Key terms: semantics, behaviors, representation, bad states, ergonomics, clear semantics, iterative, tradeoffs
5.4.1 Creating wrapper types and being OK with comingled Identities
The section uses a PastDue record to make a fact about an Invoice explicit while accepting the mutable identity inside the wrapper.
- PastDue as informational wrapper: Explain that PastDue represents something known about an Invoice’s state, rather than a separate entity with unique state or new attributes, and that a record provides a lightweight wrapper for expressing it.
Why it matters: The wrapper makes the meaning of the invoice’s state explicit in the model. - Mutable identity inside data: Explain why wrapping the mutable Invoice does not make it a value, and why the section accepts that compromise rather than requiring an immutable copy.
Why it matters: This lets the model become clearer without first replacing the legacy Invoice class.
Key terms: PastDue, Invoice, simple wrappers, records, mutable identity, value, clarity, shallow immutability, quarantine
5.4.2 Being OK with imperfect semantics
This section explains why a PastDue wrapper can be useful even though it cannot enforce its full meaning, and how to weigh that imperfection in a data-oriented design.
- Contextual meaning of PastDue: Distinguish PastDue from self-contained types such as NonNegativeInt and Degree: whether an invoice is past due depends on another date and potentially on information outside the invoice.
Why it matters: It explains why a useful type name does not necessarily prove the condition it names. - Value of an imperfect wrapper: Justify keeping a simple PastDue wrapper despite its semantic imperfections: it preserves and communicates a distinction that would otherwise be implicit after the method that computed it.
Why it matters: The type can make a domain distinction visible without requiring the design to capture every fact needed to verify it.
Key terms: PastDue, NonNegativeInt, Degree, semantics, wrapper type, clarity of communication, semantic imperfections
5.4.3 Designing the algebra for Late Fees
This section compares ways to model a late fee’s lifecycle in Java and uses generics to balance usable data types with compile-time lifecycle constraints.
- Distinct Lifecycle Data Types: Explain why representing Draft, ApprovalStarted, Billed, and Rejected as separate data types makes lifecycle invariants expressible, and why duplicating their shared fields is unattractive.
Why it matters: This establishes what a less repetitive model must preserve: meaningful lifecycle constraints. - Limits of Shared Field Extraction: Describe why wrapping the common fields in a reusable type reduces duplication but makes it awkward to use late fees collectively, even with a sealed hierarchy.
Why it matters: Removing duplication is not enough if routine operations on the resulting types become cumbersome. - Runtime Lifecycle Tradeoff: Explain how factoring out what differs makes late fees easier to use together while moving lifecycle protection from compile-time types into runtime checks.
Why it matters: It shows why a convenient representation can still lose important guarantees about billing behavior. - Parameterized Late Fee Lifecycle: Explain how making LateFee generic over its lifecycle state retains a common late-fee representation while letting methods require particular states at compile time, and identify the acknowledged readability cost.
Why it matters: This is the section’s chosen balance between working with late fees collectively and making important lifecycle restrictions visible to the compiler.
Key terms: Draft, ApprovalStarted, Billed, Rejected, semantic invariants, wrappers, sealed, LateFee, pattern matching, lifecycle
5.4.4 Modeling the decisions
The section models decisions about draft late fees as data, uses lifecycle types to restrict assessments to drafts, and explains why designing before implementation helps explore alternatives.
- Decisions as Data Types: Describe how the decisions about draft late fees can be represented as data types, some consisting only of a name and others carrying attributes.
Why it matters: This gives the draft late-fee decisions an explicit representation before their implementation is written. - Draft Only Assessment Types: Explain how parameterizing LateFee by lifecycle lets the data model express that Assessments deal with Drafts, not Billed or Rejected late fees.
Why it matters: The type of an Assessment can express which lifecycle state the business rule permits. - Design Before Implementation: Justify staying above the implementation while modeling these decisions: it allows rapid exploration of how alternative designs and representations affect the system before committing to code.
Why it matters: The section treats the decision model as a way to evaluate designs before writing their implementation.
Key terms: decisions, data types, attributes, draft late fees, LateFee, Assessments, Drafts, Billed, Rejected, type system
5.4.5 The high-level data model
The section explains why a multi-type data model can be worth its extra code: it makes the domain understandable and constrains billing at compile time, while leaving room to choose less typing.
- Value of explicit domain types: Explain why the author considers the extra data types worthwhile despite concerns about class proliferation and lines of code. Describe how the types make the domain understandable and constrain what must be constructed before a bill can be sent.
Why it matters: The useful measure of this model is whether it makes the domain clear and unsafe billing harder, not whether it uses fewer lines. - Choice of typing level: Explain whether the author requires every project to use this many types, and what should guide the choice.
Why it matters: Type safety is a design option to apply where its benefits justify its cost, not a fixed type count to pursue.
Key terms: data-oriented code, LateFee, Lifecycle, review type, safe by construction, type safety, invariants, amount of typing
5.5 Interacting with legacy code
Introduces three ways to connect a newly designed data model to legacy code and explains the tradeoff between greater control over semantics and the cost of changing existing code.
- Legacy interaction options: Describe the three options for fitting external concerns into the designed model: fit the code to what already exists, isolate the how from the what, or reshape the existing world. Explain that these options can be combined within one feature.
Why it matters: It gives you a way to think about connecting a data model to existing systems without assuming one approach must be used everywhere. - Semantic control and refactoring cost: Explain why moving toward reshaping existing code can give greater control over semantics but require more expensive changes, and why day-to-day work calls for a balance.
Why it matters: It helps you choose a practical degree of refactoring rather than treating the most ambitious option as automatically best.
Key terms: what’s already there, how, what, external concerns, data-oriented, semantics, deeper cuts into existing code
5.5.1 Fitting into what’s already there
This subsection shows how fitting a domain design directly around existing dependencies can obscure its purpose and make its behavior harder to trust.
- Costs of fitting existing dependencies: Explain how extending each method to use existing services, entities, and environmental reads can shift attention away from its intended domain behavior. Use buildDraft to describe why that shift makes code harder to trust and maintain.
Why it matters: A method is easier to maintain when its work matches the purpose its name suggests.
Key terms: buildDraft, external dependencies, existing services
5.5.2 Separate how you get the data from what you do with it
This section separates fetching data from using it, explains why that boundary helps, and identifies a remaining coupling to external service layouts.
- Data fetching boundary: Explain how to refactor a method that reads from an external dependency so it accepts the needed data as an argument while another method fetches it. Describe how repeating this across the feature separates getting data from doing something with it.
Why it matters: It lets the feature’s core focus on what it does with data rather than where the data comes from. - Isolated external reads: Explain why gathering network calls and database reads in one place makes the feature easier to reason about, test, and refactor.
Why it matters: Concentrating failure-prone reads gives the rest of the feature a clearer boundary. - Remaining service layout coupling: Describe the coupling that remains after fetching and processing are separated: method arguments can still reflect what external services happen to provide.
Why it matters: Separating fetching from use is an improvement, but it does not by itself remove every influence of external systems on the model.
Key terms: external dependency, core, how, what, atomicity, side-effects, network calls, database reads, buildDraft, assessDraft
5.6 Decoupling from the Tyranny of What's Already There
This section shows how a data-access boundary can assemble the data a feature needs without exposing the services and repositories that supply it.
- Data access boundary: Explain how a smart access layer lets a feature use the data it wants rather than inherit the structure of existing services, repositories, and entities.
Why it matters: The feature's design need not be dictated by earlier infrastructure decisions. - Unified customer data: Describe why the section groups payment terms, ratings, and approvals into one logical Customer data type.
Why it matters: A well-chosen data type can express the feature's meaning while concealing where each piece of information came from. - Customer construction responsibility: Explain how a façade can construct the unified data type, and why the section does not require that particular encapsulation.
Why it matters: The choice of component is flexible as long as the feature is insulated from the work of gathering its data.
Key terms: smart access layer, boundary layer, plain data, Customer, Payment Terms, Ratings, Approvals, façade, repository, Data Access Object
5.7 The finished data model
The section explains why a purpose-built data model is worth considering despite its visible mapping and maintenance costs.
- Purpose-built data representations: Explain why data-oriented programming makes it practical to reshape existing code into a model suited to a particular task, and identify the boundary mapping this requires.
Why it matters: You need not let an existing Entity dictate the shape of the model used for a new behavior. - Visible costs and complexity: Explain why the finished model can look like a lot of code without necessarily creating all that complexity, and contrast its visible costs with those of legacy code.
Why it matters: Visible modeling work can be easier to judge than complexity scattered through a legacy code base.
Key terms: plain data, identity objects, representations, mapping code, boundaries, domain, legacy code, requirements, new data types
5.8 Wrapping up
The section reflects on how focusing on data makes messy real-world requirements visible and gives developers control over enforcing invariants.
- Visible Requirements Through Data: Explain how focusing on data helps with ambiguous requirements in a messy real-world project.
Why it matters: Visible requirements are easier to discuss when real-world constraints make design choices difficult. - Invariant Control Through Data Algebra: Explain what changing the algebra of the data lets developers control.
Why it matters: The shape of the data affects how firmly rules can be enforced.
Key terms: data-oriented programming, requirements, ambiguity, algebra of our data, invariants
5.9 Summary
Where this is used later
- The Data Oriented Thought Process (chapter 10) · Using data to tell the story of a process.
- Capturing rules as plain data (chapter 8) · Earlier representation of decisions as data.
- Implementing the deterministic core (chapter 6) · Implements steps guided by the modeled data transformations.
- Treat legacy Entities as Data Transfer Objects (chapter 6) · The need to fit new domain code into what already exists.
- Organizing code around determinism (chapter 6) · The separation provides a starting point for organizing the implementation around determinism.
- On the criteria by which we break down an implementation (chapter 6) · Introduces separating how data is obtained from what is done with it.
- Functions, Purity, and Determinism (chapter 6) · The earlier separation of getting data from acting on it.
- Implementing the non-deterministic shell (chapter 6) · The implementation can keep external interactions apart from the code that works on obtained data.
Concepts explained in this chapter
- data typeA data type is a classification of data that determines its representation, permitted values, and valid operations.
- lifecycleA lifecycle is the sequence of states and changes an entity undergoes over the course of its existence.
- type safetyType safety is the property that a programming language or program prevents operations from being applied to values of incompatible types.
- invariantAn invariant is a condition that must remain true across the valid states of a data structure or computation.
- data-oriented programmingData-oriented programming is a programming approach that organizes software around explicit data representations and operations on those representations.
- data transformationData transformation is the process of producing successive data states by changing or converting an existing representation.
- decision makingA decision is a modeled choice among alternative outcomes or actions based on available information.
- wrapperA wrapper is a type or software component that encloses another representation or interface and exposes a deliberately shaped semantic interface around it.
- requirementsA requirement is a stated condition or capability that a software system or process must satisfy.
- behaviorA behavior is a discrete computation or operation that changes a system from one state to another and produces outputs from inputs.
- identity classAn identity object is an object whose distinctness is determined by its identity rather than solely by its current data values.
- illegal stateAn illegal state is a program state that violates the validity constraints imposed by its data model or domain rules.
- business ruleA business rule is a domain constraint or policy that determines valid actions, states, or outcomes.
- algebraic data typeAn algebraic data type is a composite type whose values are formed by combining product and sum alternatives of other types.
- pipelineA pipeline is a sequence of processing stages in which data is passed from one stage to the next.
- invoiceAn invoice is a document or domain entity stating an amount owed for supplied goods or services.
- semanticsSemantics are the intended meanings that a program expresses through its data and operations.
- refactoringRefactoring is the restructuring of existing software without changing its externally observable behavior.
- dependencyA dependency is a relationship in which one software element relies on another element's data, behavior, or availability.
- union typeA sum type is a type formed by combining alternative types with OR semantics so that a value belongs to one of several permitted variants.
- dataData is information represented independently of the behaviors that operate on it.
- stateThe data values that describe the current condition of an object or entity.
- mutable objectMutability is the property of a value or object whose state can change after it is created.
- shallow immutabilityShallow immutability is a condition in which an object's own fields cannot be changed while objects reachable through its references may still be mutable.
- optionOptional is the Java container class that represents either a present non-null value or the absence of a value.
- repository patternA repository is an abstraction that provides collection-like access to domain objects while hiding the underlying data storage mechanism.
- parameterizationParameterization is the technique of defining a type or computation in terms of explicit parameters that specialize its behavior or representation.
- algebraic operationAn algebraic operation is a rule for combining elements of specified sets to produce an element of a specified result set.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.
