Ian Bicking wrote: > On Wed, 2002-04-03 at 10:06, Geoffrey Talvola wrote: > > In fact, you could simply ignore awake() and sleep() > entirely and just > > implement your own before and after methods in respond(), > something like > > this: > > > > def respond(self, trans): > > self.preRespond() > > try: > > try: > > Page.respond(self, trans) > > except: > > self.rollbackTransaction() > > raise > > else: > > self.commitTransaction() > > finally: > > self.postRespond() > > > > Or whatever sequence suits your needs. Provide preRespond() and > > postRespond() as needed, and just leave awake() and sleep() alone. > > Yes, I'm already close to this, I might as well just go all the way -- > but I think such a preResponse/postRespond would be generally better > than awake/sleep, and it would be good if Accepted Webware Style > directed people towards a good, flexible style. > A few improvements in the builtin subclasses of Servlet (Page, > SecurePage, and more such pages that don't yet exist) would > be good for > Webware, I think. There's things that everyone is doing, but they are > all hacking them into their own SitePage.
I agree -- preRespond/postRespond as written above is a tiny bit nicer than awake()/sleep() because you don't have to include the trans parameter. That always bugged me. Other than that, I don't see much difference (assuming we fix the exception handling in the current awake/sleep so that sleep() is called if an exception happens in respond()). And it might be confusing to add yet another pair of methods when awake() and sleep() could do the job. I also don't like the names preRespond and postRespond -- kind of ugly. And the natural names awake() and sleep() are already taken. Let's think carefully before making a change like this in Webware because we're stuck with the names we choose for a long time :-) What other things are everyone doing in their SitePage? Perhaps we need a Wiki page for improvements to Page? - Geoff _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss