From: review-reports/architect.md finding #2, SUMMARY.md Theme B
Where: every ViewModel (HomeVM, LiveVM, MovieDetailVM, ShowDetailVM, SearchVM, SettingsVM) injects raw Room DAOs — up to 7 per VM.
Issue: No repository layer between UI and data layers. Swapping TMDB for OMDb, adding a second playlist, schema migrations, or offline mode require shotgun edits across every ViewModel. LiveViewModel even exposes programmeDao as internal val so GuideGridScreen can reach past the ViewModel to Room directly — violates unidirectional data flow.
Fix (incremental): start with the 3-4 busiest DAOs:
MovieRepository (wraps MovieDao)
SeriesRepository (wraps SeriesDao + EpisodeDao)
ChannelRepository (wraps ChannelDao)
ContentRepository (wraps ContentDao)
Interfaces declared in domain/, Room-backed implementations in data/repo/. Hilt binds interface → impl. ViewModels depend on interfaces. Don't try to cover all 11 DAOs at once.
Also fixes: Idioms #8 (LiveViewModel exposing programmeDao) — GuideGridScreen gets a suspend fn or Flow from the repo, not a DAO.
From:
review-reports/architect.mdfinding #2,SUMMARY.mdTheme BWhere: every ViewModel (HomeVM, LiveVM, MovieDetailVM, ShowDetailVM, SearchVM, SettingsVM) injects raw Room DAOs — up to 7 per VM.
Issue: No repository layer between UI and data layers. Swapping TMDB for OMDb, adding a second playlist, schema migrations, or offline mode require shotgun edits across every ViewModel.
LiveViewModeleven exposesprogrammeDaoasinternal valsoGuideGridScreencan reach past the ViewModel to Room directly — violates unidirectional data flow.Fix (incremental): start with the 3-4 busiest DAOs:
MovieRepository(wrapsMovieDao)SeriesRepository(wrapsSeriesDao+EpisodeDao)ChannelRepository(wrapsChannelDao)ContentRepository(wrapsContentDao)Interfaces declared in
domain/, Room-backed implementations indata/repo/. Hilt binds interface → impl. ViewModels depend on interfaces. Don't try to cover all 11 DAOs at once.Also fixes: Idioms #8 (LiveViewModel exposing programmeDao) — GuideGridScreen gets a suspend fn or Flow from the repo, not a DAO.