title: Sharing Realm fields on Android
body: <p>Realm on Android <a href="https://github.com/realm/realm-java/issues/761" rel="nofollow">doesn't support model inheritance/polymorphism</a>.</p>
  
  <p>So is there any way to share fields on Android? We have 5 models that all share the same synchronization-related fields and code. We use inheritance in our current SQLite models; if we switch to Realm, is our only choice to duplicate the sync fields across each of the 5 model classes?</p>
  
  <p>As a workaround, I'm thinking about having those classes implement a <code>Syncable</code> interface with getters and setters for the shared fields, which at least let me share sync functionality. Is there a better way?</p>
  
  <p>To share sync functionality, my best guess is to make a static <code>Synchronizer</code> class and pass it <code>Syncable</code> model objects. <code>Synchronizer</code> methods will use the <code>Syncable</code> interface to operate directly on model objects' shared, sync-related fields and delegate operations on type-specific fields. Alternatively, I could provide each model object its own <code>Synchronizer</code> instance...</p>
  
  <p>Trying to find the right way to work around the inheritance limitation is really stretching my OOP skills... help is appreciated!</p>