Why a reference architecture?  The motivation for creating and now presenting this reference architecture is that the way we build connected mobile

metablog: Blackbird: A reference architecture for local-first connected mobile apps

submited by
Style Pass
2022-06-21 23:30:04

Why a reference architecture? The motivation for creating and now presenting this reference architecture is that the way we build connected mobile apps is broken. Our current approach(es) to building mobile applications are broken and none of the proposed solutions appear to help. How are they broken? They are overly complex, require way too much code, perform poorly and are unreliable.

Very broadly speaking, these problems can be traced to the misuse of procedural abstraction for a problem-space that is broadly state-based, and can be solved by adapting a state-based architectural style such as in-process REST and combining it with well-known styles such as MVC.

More specifically, MVC has been misapplied by combining UI updates with the model updates, a practice that becomes especially egregious with asynchronous call-backs. In addition, data is pushed to the UI, rather than having the UI pull data when and as needed. Asynchronous code is modelled using call/return and call-backs, leading to call-back hell, needless and arduous transformation of any dependent code into asynchronous code (see "what color is your function") that is also much harder to read, discouraging appropriate abstractions.

Backend communication is also an issue, with newer async/await implementations not really being much of an improvement over callback-based ones, and arguably worse in terms of actual readability. (They seem readable, but what actually happens is different  enough that the simplicity is deceptive). Overview The overall architecture has four fundamental components: The model The UI The backend The persistence The main object of the architecture is to keep these components in sync with each other, so the whole thing somewhat resembles a control loop architecture: something disturbs the system, for example the user did something in the UI, and the system responds by re-establishing equilibrium.

Leave a Comment
Related Posts