On Jan 7, 2005, at 12:30 AM, Ian Bicking wrote:
Tom Schwaller wrote:Are Aspects (simple solution in CherryPy) something people would like to see integrated in Webware?
I don't like aspects; I'm not sure they exist anymore in CherryPy 2?There is a file CherryPy-2.0.0b/cherrypy/lib/aspect.py, so yes, it is still there. What I like in CherryPy is # Of course we can also mount request handler objects right here! cpg.root = HomePage() cpg.root.joke = JokePage() cpg.root.links = LinksPage() Is there something analogous in Webware: I do not rememeber?
Not really, but Winston asked about that sort of functionality a week or two ago, you can look in the archives for my response then; mostly you'd have to code it yourself.
I did indeed like that concept, and thought a long time why we couldn't do it in Webware.
The reason you can't do it in Webware but you can do it in CherryPy is that CherryPy all runs in one thread whereas Webware uses multiple threads. In CherryPy, if you only have one thread, there is just one instance of each page. Webware caches multiple instances of each page though, to handle multiple simultaneous requests. So if you have multiple instances of a page, you can't say root.joke = JokePage() because that is linking one instance of 'root' to one instance of 'joke'.
The solution I came up with is the create an index of the site so for any page, I can ask the index, "what is my parent page?" or "who are all my ancestors up to the root" so I can make bread crumbs for navigation and so forth.
-winston
------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ Webware-discuss mailing list Webware-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/webware-discuss