15.1 · MVC, MVVM, MVP, VIPER, RIBs, TCA and Clean, and unidirectional data flow

Every architecture answers the same few questions: where does state live, who is allowed to change it, and how do you test it. The names differ; the trade-offs mostly do not.

Mental model. Architecture is where you draw the lines. A good line makes one thing easy to test and one kind of change cheap; each extra line costs code and indirection.

Choosing a pattern

The family of patterns and their honest costs.

  1. How do MVC, MVVM, MVP, VIPER, RIBs and Clean compare, and which would you choose? 15.1.1 · L2
    All of them separate what to show from how to show it, and differ in how many layers they add. MVC (Apple’s original) has a model, a view and a controller that…

One-way state

Unidirectional data flow and reducers.

  1. What is unidirectional data flow, and how does a reducer make state changes predictable and testable? 15.1.2 · L3
    Unidirectional data flow means state changes travel in one loop: the view renders from a single state; user input and system events become actions (plain…

More in Architecture & API design