On Wed, Oct 1, 2008 at 10:29 PM, Darren New <[EMAIL PROTECTED]> wrote: > Bob La Quey wrote: >> >> You seem to be confusing REST with caching among other things. Caching >> != REST though REST often enhances caching. > > Oh, and describe for me the URI that represents "Decrement Fred's account by > $100, and give $50 to Sally and $50 to whoever Sally names in her > configuration record, all in one transaction."
Well if you really want to know in Django I would use something like http://accounting.com/Decrement/Fred/Sally/Assigns/$100/$50/$50/ or some such. Then the underlying frame work would parse all that (using regex for the variables) and map it to a function. The function might look something like transact(from, to, assigns=defaults) or some such. Here the arguments come from the regex and the defaults came from Sally's configuration file when to=Sally. The function, transact() would be written to manipulate Python objects. In Django, and some other web frameworks, no thought or knowledge of SQL on the part of the application programmer is needed. There is an ORM (Object Relation Manager) that automates the mapping via SQL to the database. The function transact() would automagically invoke the ORM and through the ORM SQL and the database. You do not have to like it. You do not have to use it. But it works (mostly, usual caveats and disclaimers). It is easy to understand at the level of application programming. IMHO it certainly beats the hell out of writing code to grind down to the SQL for a specific database. If you really do have to do that then Django specifically (and most other frameworks as well) allows you to drop down to that level. So far I have not had that need (Thank God.) I have written more very low level code in my lifetime than I care to think about. I started this game punching seven bit codes one bit at a time into paper tape. I do not mind at all having automatons punch bits and more for me. > Or the URI that represents "Lock my mailbox against writing until I'm done > reading my mail and I have decided what to delete and what to keep." Don't > forget to unlock it if, for some reason, I finish without unlocking it. Sort of the same as above. I will leave it for others to develop the details. A key issue for this sort of thing though and an area where REST (an HTTP) provides no solution is WATCH/NOTIFY support. See http://wisdomofganesh.blogspot.com/2008/01/roy-fieldings-fundamental-omission.html And do read the comments. > Or the URI that represents my ssh session to the server over there. Hey that is a good one. It is late. I will tackle that one day after tomorrow, cause tomorrow I go to San Diego and my day is shot. I do think I can do that :) We shall see. > No, really, not everything is REST, and not everything can be represented as > one independent round trip to a server and back. There really is state in > the world. :-) Oh, I do agree there is state. I just think there is not nearly as much of it as you seem to think. Also I am getting a lot of mileage out of thinking of some state, for instance session, as simply constucting an instance of a server, then for the duration of the instance that server is stateless. Call it a bastardized view of REST if you will but then I have never claimed to be a fundamentalist in any church. Father forgive me for I know I have sinned. Good clean fun, BobLQ PS. Anybody have any work for a socially challenged obstreperous old fart? Telecommuting, up to one day per week on-site, anywhere in SoCal. My rates are competitive, like my persona :) -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg
