I’m building a web service for a mobile app (Sencha Touch), and I’m hung up on the right way to approach this (as subjective as “right” can be).
Here’s my situation.
I’m consuming a google calendar and pushing it via JSON to the mobile app. I have two options here, and I’m not sure how to go about this.
Option 1 is to pass the calendarID via a querystring. This allows us to swap out the calendarID in the mobile app config if need be.
Example:
http://example.com/calendar/events?calendarID=xyz@group.calendar.google.com&callback=asdf
Option 2 is to use a config file on the web service to update the calendarID
Is it wise to have the config stick with the web service, or better to be able to pass the config from the mobile app?
[note] the calendar is shared among all users
Typically, in a RESTful system, you should not rely on any public data other than what is passed back to you. However, it sounds like this is more of an implementation (private) detail that the public users will not care about. So, I see no problem storing this in a config as it sounds like it will be the same on every request.
That is my take on it, at least.