GAE for Mobile Part 2 – RESTful server implementation
Did you miss GAE for Mobile Part 1?
The Development Environment
Before launching into a discussion on the server implementation, I wanted to mention that I am using Eclipse and Google Plugin for Eclipse. I am writing in Java, although you can choose to write in Python as well. If you haven’t gone through Google’s Tutorials then you should stop and do so. Google does a fantastic job of walking through installation and configuration of the IDE, the creation of a simple app, user authentication and the datastore.
I <3 REST
I think everyone that knows REST feels the same. If you haven’t done the necessary reading from Wikipedia and Java then here is the super lazy man’s guide to RESTful web services. If you are a php dude and you want to get recipes from a database, you might write a file called getRecipes.php. If you wanted to pull recipe 6 out you might call http://www.blah.com/getRecipes.php?id=6.
Notice that getRecipes is a verb, REST uses nouns instead of verbs. To get all recipes from a RESTful service you would call http://www.blah.com/recipes/. To get recipe 6 you would call http://www.blah.com/recipes/6. If you wanted to update recipe 6 you would POST instead of GET in your HTML form/AJAX request. That is RESTful web services 101.
Read the rest of this entry »
Like this:
Like Loading...