-
Notifications
You must be signed in to change notification settings - Fork 0
Database operations
Alan Sánchez Pineda edited this page Jun 9, 2021
·
1 revision
I don't think this project is actually too complex, so the database was made using only Room (and RXJava for inserts, updates and deletes). Despite the project not being complex, using the repository pattern was pretty much mandatory, so we have DAO, Repository and ViewModel classes. Because of how Room's DAOs work, database operations that require bussiness logic validations are difficult to implement directly in DAOs, so the project moves these to Repositories (for example, validating that certain values remain untouched during update operations). This also allows for these "complex" operations to be tested using instrumentation tests, so I guess it's cool.