liveBook · Manning

Chapter 10: Data Oriented Architecture

What you will learn in chapter 10 of Data-Oriented Programming in Java

The introduction frames data-oriented architecture as an approach in which objects serve as gatekeepers for exchanging data.

After this chapter you will be able to

What it builds on

Section by section

Introduction

The introduction frames data-oriented architecture as an approach in which objects serve as gatekeepers for exchanging data.

Key terms: data-oriented architecture, objects, gatekeepers, exchanging data

10.1 A small example

Introduces a file-ingestion example in which a service processes monthly change reports from an external team.

Key terms: file store, manifest, Accounts, Invoices, Disputes

10.1.1 Starting from scratch

The section establishes the minimal external libraries available for a from-scratch architecture and leaves their specifics deliberately vague.

Key terms: architecture, frameworks, ORMs, auto-wiring, TableRecord, inserts, updates, getObject(), CloudObject, read()

10.2 The Object Oriented Thought Process

The section follows an object-oriented design for file ingestion, then shows how its interfaces can still leak dependency details, permit unsafe partial processing, and obscure the system’s own boundaries.

Key terms: interface, Strategy Pattern, Transformer, BulkLoader, Factory, tightly coupled, open to extension, vulnerable to change, CloudStore, partial data

10.3 The Data Oriented Thought Process

The section sketches an ingestion system as a flow of data and argues for shaping its domain data around the task rather than around external formats or a universal model.

Key terms: Data Orientation, ascii arrow (->), Request, Manifest, RawCsvRepresentation, DomainRepresentation, JSON, Account, Invoice, Dispute

10.3.1 Resist the urge to abstract!

This subsection argues for delaying abstractions so the design can be guided by the data rather than by premature groupings of functionality.

Key terms: abstract, data, operational baggage

10.4 A way of thinking about software architecture

This section replaces rigid architecture tiers with a three-world model centered on a program’s own data and semantics.

Key terms: three distinct and broad amorphous “worlds”, things we use, things that use us, boundaries, corruptive pressure, public APIs, middle world, semantics, checks and balances

10.4.1 Start in the middle and work outward

The section argues that architecture should begin with the program’s own data types and make external systems adapt to them.

Key terms: middle world, outside worlds, data types, objects, Traditional OOP, Data Oriented Programming

10.4.2 The role of objects in data-oriented programming

This section explains how objects serve a data-oriented design by supplying the domain data the program demands and shielding its core from external APIs.

Key terms: data, objects, vend data, demands, FileRepository, CloudStore, Manifest, ResourcePath, InputStream, architectural gateway

10.4.3 Designing objects with functional core; imperative shell

This section shows how to organize a data-oriented object around determinism, separating external I/O from logic that can be tested in isolation.

Key terms: determinism, functional core, imperative shell, FileRepository

10.4.4 Keep resisting the urge to abstract!

The section warns that an apparently flexible file-parsing abstraction can reverse architectural responsibilities, while arguing for cautious abstraction primarily over data.

Key terms: architectural boundary, middle world, object store, parser, early abstraction, abstracting over data, real-world processes

10.4.5 But what if it changes?

This section argues that, for routine business code, making a small change when it is needed can be cheaper than building abstractions for changes that may never happen.

Key terms: Repository, extension, indirection, You Ain’t Gunna Need It

10.4.6 Push your semantics into the external worlds

The section shows how to protect a program’s meaning from external APIs by putting the operations it needs at the boundary rather than spreading API workarounds through the program.

Key terms: semantics, architectural boundary, upsert, Inserts, Updates, boundary, shift in ownership, approvals, boundary violation, sequential service calls

10.4.7 Checks and balances

The section explains why data-oriented architecture needs a push and pull between an application and its dependencies, rather than letting the application’s preferred semantics dictate every interface.

Key terms: three worlds, push/pull, semantics, outside worlds, Repository, Data Access Object, scanning, dependencies, agnostic

10.4.8 Dealing with the outside world that uses our program

The section shows how requiring domain data at the program’s boundary keeps HTTP and JSON concerns outside the program.

Key terms: boundary, domain types, semantics, HTTP, JSON, well modeled data, object

10.4.9 Always watch your boundaries

This section shows how fixing a database atomicity problem can undermine architectural boundaries, and argues for solving the problem within the database-facing part of the program.

Key terms: atomicity, transact method, repositories, partial state, architectural boundaries, UpdateAndInserts, outside world

10.5 Good boundaries make change easy

The section uses a failing REST integration to show how good boundaries let an application change its entry point without rewriting its core.

Key terms: three-worlds perspective, integrations, core program, new front door, good boundaries

10.6 Wrapping up

The section frames architecture as boundaries between three worlds and argues that making those boundaries speak data helps decouple them.

Key terms: middle, things we use, things that use us, boundaries, data, decouple

10.7 Summary

Where this is used later

Concepts explained in this chapter

← Chapter 9: Refactoring Legacy Code Chapter 11: Data Oriented Testing →

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.