Unidirectional Data Flow

Applications must respond to input from multiple sources: data being loaded from the back end as well as inputs from the user. If you do not have a plan in place to combine these sources, you could code yourself into a mess of complex logic that is difficult to maintain.

Unidirectional data flow is an architecture pattern that has risen to prominence and that plays nicely with the reactive patterns you have been using with Flow and StateFlow. Unidirectional data flow tries to simplify application architecture by encapsulating these two forces – data from the back end and input from the user – and clarifying their responsibilities.

Data comes from a variety of sources, such as the network, a database, or ...

Get Android Programming: The Big Nerd Ranch Guide, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.