Backbone's default service layer depends on a fairly rigid API design. In order to integrate with CouchDB's slightly irregular Documents API, we can create a set of base Document classes that override key methods to work with CouchDB. By inheriting these Document classes, Models and Collections that correspond directly to CouchDB Documents fit seamlessly into normal Backbone workflow.
This approach is advantageous for several reasons:
- The default Backbone library remains predictably intact
- Documents can be bound to specific CouchDB view functions or databases