emberjs/data — pull request #535 by olmeca (2012-12-18 14:06:38+00:00)
Title: Refactoring: moved code for building JSON message from DS.RESTAdapter to new DS.RESTMessage

As the REST service I work with (based on Java JSR 311) uses a different JSON message structure than what the DS.RESTAdapter provides, I had to subclass the RESTAdapter. But It turned out I had to override many methods to implement a subtle difference in message structure:
- createRecord()
- didCreateRecord()
- updateRecord()
- didUpdateRecord()
- didFindRecord()
- didFindAll()
- didFindQuery()
This led to a very fragile subclass: any changes to above methods would have to be reimplemented in my subclass. Hence the reason for moving the concern of serialising/deserializing of the message structure to a separate class, called DS.RESTMessage.
Using this approach I only have to subclass the RESTAdapter to create messages of my RESTMessage subclass. This subclass currently only contains one method. The fragility is eliminated.