I'm developing project following MVP architecture. Usually, when I use recyclerView, my presenter controls Adapter data. But now I need to make recycler adapter with data from cache (or something like cache), recycler's size dosen't depends on cache size, so I make cache via HashMap where the key is - position of recycler, if there is an item in map then the data shows, else empty row with something like "add events" btn. And I can't realize where the place for that cache in such structure - Model (Dao or something like CacheManager) or in Adapter.
The cache idea is following: I have some types of events which store in database, every event modifying changes it in db - so the cache has to be updated either.
The main questions are: where to keep this cache and load it to adapter, how can i keep it sync with database changes.
P.S. Also I tries to use RX, so if it can be solved with it - would be very interesting to try.
P.P.S If it the Repository pattern is the way to solve - welcome. Read about it sometime ago.