Skip to content
academia.sh

Course Intermediate

Architecture Components and the Data Layer

Published Updated

By the end of this course

Start course

01

Application Architecture

UI, domain and data layers, a view model that survives configuration changes, state holders, flow-based observable state, unidirectional data flow and dependency injection.

  1. 01 The Layer Model The layer model splits an app into UI, domain and data layers, and dependencies point only inward. The lesson measures whether the answer to a read comes from memory, disk, the network or a default.
  2. 02 The View Model A view model holds screen data so that it survives a configuration change, but not process death. The lesson measures how the origin of a read changes when the screen rotates and when the process dies.
  3. 03 State Holders A state holder gathers a screen's state in one place; saved state selects the fields that return even after the process dies. The lesson measures which origin each field of a screen returns from and with which saved fields.
  4. 04 Observable State Observable state is a state flow that publishes a new value to collectors as its value changes; a flow always has an initial value. The lesson measures the origin of the value a collector reads before loading finishes and after it finishes.
  5. 05 Unidirectional Data Flow In unidirectional data flow, events go up, state comes down, and the UI does not write state directly. The lesson measures which tier gives the answer when the new state built by a reducer that handles an event is read.
  6. 06 Dependency Injection In dependency injection, a class does not build the objects it needs itself but receives them from outside. The lesson measures which tier answers a read in the production chain built by a container, and how the answer changes when the chain changes in a test.

02

The Data Layer

The repository pattern, the local database, key–value storage, file and media storage, the network client, caching and offline support, paged data loading and background work.

  1. 01 The Repository Pattern The repository pattern hides where data comes from by ordering local and remote data sources behind a single interface. The lesson measures the origin of an answer in an ordered lookup chain and shows how the origin changes when the order changes.
  2. 02 Local Database A local database keeps the data of an application on the device disk through entities and data access objects, and a migration carries old rows to the new schema when the schema changes. The lesson measures the origin of a read after a migration and what a new column falls to in old rows.
  3. 03 Key–Value Storage A key–value store keeps small preferences under a single key; reads and writes are asynchronous, and the value arrives as a flow. The lesson measures the origin of a read of a preference that was never written and how that origin changes when the user writes it.
  4. 04 File and Media Storage An application reaches the files in its own directory directly and the media of others through the media store and permission rules. The lesson measures the origin of a read of a file in the app-specific directory and what a file that does not enter the chain falls to.
  5. 05 The Network Client A network client defines a request, passes it through interceptors, and decodes the incoming response with serialization; the decoded fields build the network tier of the read. The lesson measures the origin of a read of a decoded response and what a cached response and a field that cannot be decoded fall to.
  6. 06 Caching and Offline Support In the single source of truth pattern the UI reads only the local database, and the network only refreshes the database. The lesson measures the origin of a read after a refresh, that the origin stays the same while the value goes stale when the network goes down, and what a key that is not on disk at all falls to.
  7. 07 Paged Data Loading A long list is loaded not all at once but page by page; each page is requested with a page key. The lesson measures the origin of a read of an item on a page that has not yet been loaded, how the origin changes when the page is loaded, and the same item coming from the network or from disk.
  8. 08 Background Work A deferrable job, once its constraints are satisfied, pulls from the network and writes to disk, and the next read of the screen comes from disk. The lesson measures the origin of the read once the constraints are satisfied, what the read falls to when they are not, and the distribution of origins across the fourteen lessons of the course.

Final exam

Architecture Components and the Data Layer — Final Exam

In preparation

This course's question bank is not complete yet. The exam opens here automatically once enough questions are added.

Start typing to search.

↑↓ ↵ Esc navigate · open · close