why do Realm generate proxy classes for all the model class?

350 Views Asked by At

I am trying to understand how does Realm for Android works under the hood. when I used the custom methods in our model class, couldn't see them in the generated proxy class.

1

There are 1 best solutions below

0
Christian Melchior On BEST ANSWER

The proxy classes extend your model class, which is why they cannot be final and need to be marked open in Kotlin, but that means that the proxy class automatically inherit all the methods from your model class.

You can read https://academy.realm.io/posts/is-realm-magic-makoto-yamazaki/ if you are interested in more detail.