Brick Core

Interfaces and shared helpers for implementing models, adapters, providers, and repositories in Brick.

Principles

Brick's architecture encourages using data through a single access point: the repository.

Data flow with a single provider

A repository may implement multiple providers, but after instantiation the end application is only aware of the repository. The stream of data follows one course through each provider:

Data flow with many providers

The repository is aware of provider(s), the provider(s) are aware of the adapters, the adapters are aware of models, and the models are aware of only themselves. From the reverse, models are unaware, adapters are unaware of providers and providers are unaware of repositories.

Awareness

Because models are atomic and unaware, they don't rely on (de)serializing functions (unlike with JSON serializable). Brick reduces the concerns of the end-implementation by hiding (de)serializing and fetching logic into adapters, which translate raw data between providers:

Adapters

Libraries

core
field_serializable
query