Ian Bicking wrote: >But how is putting the code in handleActions different from putting it >in writeContent or awake? > > Well, it's not really, as you said, one can do the same thing either place. It just seems to me that having BOTH is awkward. As long as we're using actions, might as well use them.
Now, my opinion is a little harsher: I think "writeXXX" methods should be used only for writing... for output. I use awake a lot for application logic, but because awake is so important to the WebKit internals, it's a little dangerous to use, and can get severly complicated when using 3 or 4 kits at once. In general, I'd like to see only superclasses mess with awake, and have leaf servlets not touch awake at all. With the current architecture, that's not realistic. >My solution was to stop using awake/sleep, and to put a >setup/writeHTML/teardown sequence in respond. Then respond (in your new >Page) catches all the exceptions. No hacking about, and has the same >effect. > > We thought about that, but decided that it's too different from stock webkit; our code would effectively be broken off from Page.py at that point. The mixin to Transaction seemed to be the least fundamental difference to the stock behavior. But I agree that your idea is better in principle. >I agree on the problem, but I don't think this is the complete >solution. For instance, my titles and such are often based on the >content, which is based on an ad hoc action. So I deal with everything >in awake (well, setup), and then everything else is rendering logic. >When it's just rendering logic, it's not as burdensome. > > True. This is just a matter of moving writeHeader() to after the setup code, of course. >I dunno... this is kind of scattered, but I feel like the problems fit >together, and the best solution will answer several at once. I'm also > > Agreed. Right now, it's possible to write tight OO servlets, but the general structure of Page.py and the lifecycle of a servlet doesn't encourage it... it encourages just putting all of your logic in writeContent(), and at that point, you're not much better off than in the old .asp days. A new structure that encouraged one to get all of their setup done up front, and then proceed to output would be nice. I suppose that's what awake() is for... >thinking in terms of a replacement for Page that doesn't try to be >backward compatible (or, rather, an alternative to Page). > > I'm very interested in what you come up with. We'll think on it, too. Thanks. ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Webware-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-devel