The book hierarchy is (bottom to top):
- Model 2. Room 3. DA 4. Repo 5. ViewModel 6. UI
The packages sequence stated as:
- db 2. model 3. repo 4. ui 5. viewmodel
The packages order does not correspond to the hierarchy. It seems it should be as follows:
- model 2. db (Room and DA) 3. repo 4. viewmodel 5. ui
The order of setup is presented, but I would suggest the ‘flow’ is highlighted as:
- Model (Bookmark: entity class)
- DAOs (BookmarkDao: SQL queries against Bookmark)
- DB (PlaceBookDatabase: ref Bookmark and BookmarkDao)
- Repo (BookmarkRepo: link PlaceBookDatabase, BookmarkDao and Bookmark)
- ViewModel (MapsViewModel: ref BookmarkRepo to add a Bookmark from a Google Place object and image)
- UI (get Google Place and pass to ViewModel)
Thanks.