liveBook · Manning

Chapter 18: Reactive and onion architectures

What you will learn in chapter 18 of Grokking Simplicity

Introduces reactive and onion architectures as two patterns the chapter will discuss, without explaining how either works.

After this chapter you will be able to

What it builds on

Section by section

Introduction

Introduces reactive and onion architectures as two patterns the chapter will discuss, without explaining how either works.

18.1 Two separate architectural patterns

The section distinguishes reactive and onion architectures by the level at which each applies and explains that they can be used independently.

Key terms: reactive architecture, onion architecture, sequences of actions, service

18.2 Coupling of causes and effects of changes

The section identifies an n × m coupling problem: adding a cart UI element requires changes across many other parts of the system.

Key terms: n × m problem, user interface (UI), cart

18.3 What is reactive architecture?

Defines reactive architecture as organizing an application around responses to events, extending event handlers into chains of responses.

Key terms: reactive architecture, event handlers, events

18.4 Tradeoffs of the reactive architecture

This section explains how reactive architecture changes the expression of ordering and outlines the tradeoffs that change can bring.

Key terms: reactive architecture, causes, effects, pipelines, actions, calculations, timeline, possible orderings

18.5 Cells are first-class state

This section turns the shopping cart’s global mutable variable into a ValueCell so reads and updates become explicit operations that can be controlled.

Key terms: first-class state, ValueCell, val(), update(), shopping_cart

18.6 We can make ValueCells reactive

This section makes ValueCells reactive by introducing watchers that run when cell state changes.

Key terms: ValueCell, watchers, listeners, callbacks, observers, event handlers

18.7 We can update shipping icons when the cell changes

Shows how watching the shopping cart cell keeps shipping icons current without updating them in every handler.

Key terms: ValueCell, watchers, update_shipping_icons(), shopping_cart

18.8 FormulaCells calculate derived values

The section shows how FormulaCells keep derived values current and let actions respond when those values change.

Key terms: FormulaCells, upstream cell, derived value, watchers, total, DOM

18.9 Mutable state in functional programming

This section explains why functional programs still need mutable state and how ValueCells can keep that state valid without guaranteeing update order.

Key terms: mutable state, cells, immutable values, global variables, ValueCell, update(), calculation, valid value, timelines

18.10 How reactive architecture reconfigures systems

The section characterizes the reconfigured reactive code as change handlers and classifies mutable cells as actions.

Key terms: reactive architecture, handler, ValueCell, FormulaCell, actions, mutable state, .val(), .update()

18.11 Decouples effects from their causes

This section explains how reactive architecture updates shipping icons when the cart changes, regardless of what caused the change.

Key terms: reactive architecture, cause, effect, global cart, shipping icons

18.12 Decoupling manages a center of cause and effect

The section explains how decoupling cart changes from their effects reduces maintenance work, and when that separation is useful.

Key terms: causes, effects, center of cause and effect, decoupled, decoupling

18.13 Treat series of steps as pipelines

Explains how reactive architecture composes steps into data-flow pipelines, when that pattern fits, and which tools support different kinds of flow.

Key terms: reactive architecture, pipeline, actions, calculations, promises, ReactiveX, streams, RxJS, Kafka, RabbitMQ

18.14 Flexibility in your timeline

The section explains when reactive architecture makes timelines easier to manage and when its flexibility is useful.

Key terms: reactive architecture, timelines, shared resources, watcher functions, ValueCell, FormulaCell, causes, effects, center of cause and effect

18.15 Two separate architectural patterns

This section distinguishes reactive and onion architectures by their roles and scale, and explains how they can be used together.

Key terms: reactive architecture, onion architecture

18.16 What is the onion architecture?

Introduces onion architecture as concentric layers for software that interacts with the world, and states its rules for interaction and inward calls.

Key terms: interaction layer, domain layer, language layer, layers call in toward the center

18.17 Review: Actions, calculations, and data

Reviews actions, calculations, and data, then explains why extracting calculations from actions naturally leads toward an onion architecture.

Key terms: data, calculations, actions, timelines, extract calculations from actions, onion architecture

18.18 Review: Stratified design

Reviews how stratified design organizes functions and shows why actions spread upward through a call graph.

Key terms: stratified design, layers, spreading rule, action, graph

18.19 Traditional layered architecture

This section describes a traditional layered web API and explains why putting the database at its foundation makes the stack nonfunctional in the book’s sense.

Key terms: web interface layer, domain layer, database layer, actions, calculations, functional architecture

18.20 A functional architecture

Contrasts traditional and functional architectures, then states how the functional design becomes an onion architecture.

Key terms: database, actions, calculations, domain operations, onion architecture, interaction layer, layers

18.21 Facilitating change and reuse

Explains how onion architecture makes infrastructure easier to change and domain logic easier to reuse by keeping external-service calls out of the domain layer.

Key terms: onion architecture, interaction layer, domain layer, external services, cart_total(), web handler, calculation

18.22 Examine the terms used to place the rule in a layer

This section uses the terms in a rule to distinguish domain logic from technical logic that belongs in the interaction layer.

Key terms: domain rule, business rule, domain terms, interaction layer

18.23 Analyze readability and awkwardness

This section weighs the ideal onion architecture against readability, delivery speed, and performance, then applies its layer boundaries to concrete examples.

Key terms: onion architecture, calculations, actions, interaction layer, domain layer, generateReport(), reduce, action, language layer

18.24 Conclusion

The conclusion distinguishes reactive architecture’s way of sequencing actions from onion architecture’s emergence through functional programming practices.

Key terms: reactive architecture, actions, onion architecture, functional programming practices

18.25 Summary

18.26 Up next…

The section closes part 2 and previews a concluding chapter about what readers have learned and where to go next.

Where this is used later

Concepts explained in this chapter

← Chapter 17: Coordinating timelines Chapter 19: The functional journey ahead →

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.