Robert Menke
04/22/2018, 11:29 PMgildor
04/23/2018, 1:50 AMRobert Menke
04/23/2018, 3:11 AMgildor
04/23/2018, 3:30 AMgildor
04/23/2018, 3:31 AMgildor
04/23/2018, 3:33 AMgildor
04/23/2018, 3:46 AMRobert Menke
04/23/2018, 5:36 PMgildor
04/24/2018, 1:13 AMRobert Menke
04/24/2018, 3:28 AMgildor
04/24/2018, 3:31 AMSELECT JOIN
to some data object).
So this is O and M - object mapping, no R
Also you can check official docs authdors do not claim that Room is ORMgildor
04/24/2018, 3:32 AMRobert Menke
04/24/2018, 12:41 PMnil2l
07/18/2018, 8:34 AMEverything become even more complicated when you allow to change data using Active Objects patter or even just using setter, there are a lot of problems (threading, IO operations, sync/async access) some of them has workarounds, but ORM become more and more complicated (check for example Core Data from iOS)Could you explain, what exactly become a problem when ORM joins tables implicit? And what is about Code Data? Is it like Room or ORM? Thx
gildor
07/18/2018, 8:35 AMnil2l
07/18/2018, 8:36 AMgildor
07/18/2018, 8:37 AMCould you explainBecause you do not control threading, you just don’t know if this getters/setter is syncronous or asyncronous and Core Data has a lot of hacks how to update data across threads using caches and merge of those caches
gildor
07/18/2018, 8:40 AMnil2l
07/18/2018, 8:42 AMgildor
07/18/2018, 8:44 AMgildor
07/18/2018, 8:44 AMUser
and access property address
in ORM way. When address will be loaded dynamically on accessgildor
07/18/2018, 8:46 AMR
- Relations
and request user together with address as data object (without save() method) from some async API you will get some other abstraction, not ORM, but what Room is: DB helper with object mappingnil2l
07/18/2018, 8:50 AMgildor
07/18/2018, 8:50 AMsave()
methods for the record, you cannot make you data immutable and you have a lot of problem with it (you passed data to another thread and this thread changed something, welcome to hell now). To avoid that you need an interface only with getters and without ORM methods but again, you need some wrapper that hides your ORM data objects from consumer.
And Room handles all this perfectly. No extension of basic class, no “save()” method on data models. But you just have a separate DAO method where you pass updated datagildor
07/18/2018, 8:51 AMSeems like objects there are accessable only from the main threadIt’s not exactly true, you can manage it in multiple threads, but it’s pretty tricky and error prone thing
gildor
07/18/2018, 8:53 AMwhat’s wrong here with an implicit joiningEven with coroutines you can have problems there. What if you want to display list of users with their address in RecyclerView? Yes, coroutines provide you async wrapper and it’s fine, but to use it for such use cases you need to prefetch all the data before usage in list. Or you need some loaders on each piece of data on your view on RecyclerView, also possible of course
gildor
07/18/2018, 8:54 AMnil2l
07/18/2018, 8:55 AMgildor
07/18/2018, 8:55 AMnil2l
07/18/2018, 8:58 AMgildor
07/18/2018, 8:59 AM