After a few native iOS/Android projects I’m now on a CakePHP project. On this project I’ve learned to keep the main part of the model specific code inside the model itself. This worked great, because of the cleaner controllers.
Today I’ll start on a native iOS/Android project which retrieves it’s main part of the data from a web service. Now I’ve questioned wether to put the download specific code inside the model or just create some kind of download helper. In CakePHP all the retrieval of the data was done inside the model. It made the code quite silk and smooth 🙂 What’s your opinion?
In my apps (both android and ios – same functionality, two platforms), I created a “download helper” class, whose job is to marshal requests from app to the server and then parse the responses into a format that the app’s model can understand. Technically it’s still part of the mode, if you’re after a clean separation, but it provides a nice layer between the actual “model” and the raw data, so that I can modify just one class if the source or the format of the data changes.