• Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: API design
    • None

      We need to figure out how the Schema should be exposed to users.

       

      In Realm Java we right now have RealmSchema and RealmObjectSchema classes, which are used by both Realm and DynamicRealm.

       

      This is a bit confusing as some mutator methods on RealmSchema throw when accessed from Realm but not from Realm Object.

       

      Instead, I would propose we encode the difference in the type system through 4 classes

      • class RealmSchema (immutable)
      • class RealmObjectSchema (immutable)
      • class MutableRealmSchema() : RealmSchema (mutable)
      •  class MutableRealmObjectSchema: RealmObjcetSchema (mutable)

      This way the difference is visible in the type system. 

      TODO

      • Investigate if the above is feasible.
      • If yes, define the API surface for each class.
      • If no, figure out how the API then should look like

            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: