[Dancer-users] URI design question
Mr. Puneet Kishor
punk.kish at gmail.com
Wed May 25 04:50:42 CEST 2011
Not really a Dancer-question per se, but you all are really, really smart, hence...
So, I've taken this whole REST thing to heart. My approach is that the web application itself is a client now, just like a command-line program might be a client, to the data store. So, when the web page loads, even the very first time, it is like an empty form. On load, an ajax query is fired to GET the records that are then filled in. Consider a simple books catalog (make believe app).
1. User goes to [http://myapp.com]
2. A web page loads. It has all the "chrome" (the logos, buttons, etc.), but no books. On load, a call is made to [http://myapp.com/books] which sends back a JSON object with all the books, and the web page comes alive. Except, the address bar in the browser still says [http://myapp.com]. Ok. no matter.
3. The books are tagged. So, the user clicks on one of the tags, say "Thrillers," and an ajax query is fired to [http://myapp.com/books/tag/thrillers]. Once again, the correct data are received and the web page is filled in with the results. Except, the address bar in the browser still says [http://myapp.com].
You get the idea. Since all interaction is via ajax, the browser never refreshes completely. So, the user has no visual indication as to where (s)he is on the web site. Which also leads to a problem -- there is no way to send a link to anyone.
In other words, is it possible to change the address in the browser without refreshing the browser? Any other thoughts on such an application design?
Puneet.
More information about the Dancer-users
mailing list