Uploaded image for project: 'Realm Kotlin'
  1. Realm Kotlin
  2. RKOTLIN-66

Design RealmObject interface

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: API design
    • None

      In the Compiler Plugin we right now use the `@RealmObject` annotation, but we need to figure out exactly what the API for working with Realm Objects should look like.

      In Realm Java we have both an abstract RealmObject super class and a RealmModel marker interface. 

      With default methods on interfaces we can probably get away with just an interface for Kotlin/Java 8, but we need to figure out the exact semantics.

       

      QUESTIONS / TODO

      • How should a Realm Object be identifier?
      • What about DynamicRealmObject / Embedded Objects?
      • Interface default methods have some limitations, ie. we cannot have "default properties". Figure out exactly what is possible.
      • If we don't have a state on the marker interface, how would people access it?
      • How do people register observers on objects?
      • Writeup design doc with pros/cons for different solutions

            Assignee:
            claus.rorbech@mongodb.com Claus Rørbech (Inactive)
            Reporter:
            christian.melchior@mongodb.com Christian Melchior (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: