Mercury-IM/persistence-room/README.md
2019-06-10 02:52:08 +02:00

31 lines
1.3 KiB
Markdown

# Room Persistence Layer of Mercury
This Android Module contains an implementation of the interfaces of the `persistence` module.
In particular it defines SQL schemes and provides DAOs as well as implementations of Model classes
and Repositories that utilize the [Room Database Framework](https://developer.android.com/topic/libraries/architecture/room).
## Packages and Classes
### `AppDatabase`
defines what makes up the database itself. It lists all available entities and provides dao classes.
### `dao` package
Contains data access objects (DAOs) which provide CRUD methods (Create, Read, Update, Delete) for
all the models.
Note, that the `BaseDao` interface already defines methods for creating, updating and deleting
entities and is extended by most DAO classes.
### `model` package
Contains classes that represent the data itself in form of models.
### `repository` package
Contains implementations of data repositories. Repositories are single sources of truth and provide
a user-friendly separation layer between the application and the DAOs.
Ideally this layer would also provide access to the XMPP domain, but this is still subject to
discussion.
### `type_converter` package
Contains Room specific type converter that convert non-basic data types into basic data types which
can be handled by the database and vice versa.