The Clean Architecture is more about separating software into loosely coupled layers, and…
Pedro Teixeira
22

EDIT: After going to sleep and waking up, I’ve realized that I should remove “incorrect information”, and as this was valid criticism, I’ve replaced the questionable terminology with “cold repository” and “reactive repository with hot event source”.

— — — —

Now this I can actually agree with, clean architecture is about the strict separation of data/domain/presentation layers. In fact, the MutableLiveData that exposes the RealmResults directly isn’t a truly “clean” solution, for clean it ought to be mapped to immutable domain models on a background thread (instead of using RealmObjects as domain models directly) — but with Realm that’s tricky because for that you need to listen on your own background looper thread, which is completely out of scope for this article.

In this case, I used that term (despite not entirely matching the actual definition) because people often claim they have “created clean architecture and abstracted away their database layer”, but they copy from the Realm without listening to changes in it, which defeats the purpose of Realm being a “reactive data layer” out of the box. If I call out the major key difference (which is that it is in fact reactive in comparison), I think the difference is explained a bit better.

Fair criticism by the way, you are correct. It is just more “straight to the point” to describe it this way in this particular case.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.