kiva / backbone.siren

Converts Siren JSON representations into Backbone Models
MIT License
14 stars 3 forks source link

Leveraging backbone-relational + lazy loading sub-entities #2

Closed gxxcastillo closed 11 years ago

gxxcastillo commented 11 years ago

I haven't yet looked at how backbone-relational implements the related models, but I'm thinking we can leverage some of that to implement the sub-entities. If the response has a sub-entity link, it lazy loads the entity from the server and returns an entity object when the sub-entity is accessed. -@apsoto on the siren-hypermedia google group

gxxcastillo commented 11 years ago

There is a backbone-relational branch where I tried incorporating it but had little luck. The biggest problem I had with backbone-relational was that it requires model "types" and thus also had many built in assumptions about these types; It would be ideal if we could leverage Siren's self describing nature and avoid types. For now I'm going back to focusing on the master branch but still using backbone-relational as a guide.

Lazy loading has been implemented (not tested)