Kevin Dangoor wrote: >>Oh, and I guess finally, you never have to change objects to attach >>other objects, which decreases the localization of the code (since >>parent objects must know about their children). > > > This one's more a matter of syntax. You can define a route that says > "/foo/bar/baz" maps to something or: > > cherrypy.root.foo.bar.baz = NewBaz() > > it's still only one line. If we were talking Java, we'd have to > configure the URLs independently.. but not with Python.
I guess what particularly bothers me about that is that you are monkeypatching cherrypy.root, which doesn't feel very clean. And the very existance of cherrypy.root is very problematic from my perspective, as "root" (especially as a module global) implies CherryPy is in control of the application server. Application root, sure, that makes sense -- and it's not that big a deal to create an object hierarchy that fits your application, starting from the root for your application. Of course, I can mount CherryPy's root somewhere under the main site (using Apache or whatnot), but that means each CherryPy application needs its own process. That said, I don't think that I'd want to give the root of a site to Routes either, as whole-path-matching isn't something I'd want to do for multiple applications at one time. That seems like it would be very confusing. -- Ian Bicking | [EMAIL PROTECTED] | http://blog.ianbicking.org

