liveBook · Manning

Reactive architecture

As explained in Grokking Simplicity

A software architecture pattern centered on asynchronous communication and systems that respond to changing events or conditions.

Reactive architecture structures software around responses to events. Instead of sequencing actions as “Do X, then Y,” it expresses “When X happens, do Y,” extending event handlers into chains of handlers and pipelines. section 18.3 section 18.25

The pattern reorganizes action sequences in three important ways:

  • Decouples effects from their causes: an effect responds to a state change or event regardless of which operation caused it. section 18.11
  • Treats steps as pipelines: simple actions and calculations respond to preceding actions and compose into longer sequences. section 18.10 section 18.4
  • Creates timeline flexibility: independent handlers can run through shorter timelines when they do not share resources. section 18.14

Updating shopping-cart indicators

Suppose free-shipping icons depend on the current cart. A conventional design updates the icons separately after add, remove, and empty-cart clicks. A reactive design states the rule once: whenever the cart changes, update the icons, regardless of the cause. A ValueCell can hold mutable state and notify watcher functions when its value changes, forming a reactive pipeline. section 18.11 section 18.14 section 18.10

Reactive architecture is useful for web services and user interfaces, but it is not automatically better. Separating causes from effects can improve maintenance and precision, yet may also make ordering less readable or permit unwanted timelines. Apply it where causes and effects need to vary independently. section 18.3 section 18.4

How Grokking Simplicity covers it

How deep it goes
Explains event-driven sequencing, pipelines, mutable state, resource-separated timelines, and tradeoffs, stopping short of implementation code.
Examples
Uses shopping-cart indicators, ValueCell watchers, FormulaCell totals, document processing, and user notifications as concrete cases.
What it assumes
Assumes familiarity with first-class functions, higher-order functions, functional tools, and data-transformation pipelines.
What you can do after
Apply it to decouple causes from effects, compose action pipelines, and design flexible event-driven timelines.
How it connects
Connects event handlers, pipelines, mutable state, ValueCell, FormulaCell, functional programming, and onion architecture.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Simplicity. The section links point to the parts of the book it draws on.