Ben Parker wrote:There is a document called Anatomy of a webware transaction that should be reviewed / revised if necessary but what I do:
awake. My view (I'd love to hear others) is that an unhandled exceptionAgreed.
in awake() is called a bug and should be fixed in development. I don't want
the framework to force me to write sleep() with extra conditional logic to
avoid clobbering an exception raised from a bug I may code into awake().
And I agree that they should be thought of in pairs; everything that awakes must also sleep. In fact, everything must also respond, but it can do so by sending a redirect or running an action.
This has bugged me about WebKit for a while, and we always change our SitePage to make it more consistent:
Our servlets ALWAYS do awake - respond - sleep. WriteHTML() is really inside of respond, and is effectively the default "action". Other actions cause WriteHTML to not really run, and you get bone-headed output like:
<html><body></body></html>
Usually, when an action is run, you either want to redirect somewhere OR do some output. Either way, there is still a response. But the output chain that is so nice in WK is short-circuited with actions.
Also, I'm not sure that the action should be called from respond... respond should be about sending data to the client. Action is usually used to do some application logic, like saving data to a database. Sometimes it's an alternate output, I suppose...
How do most people listening use actions?
init -> setup long term resources needed for the servlet (load and compile all templates)
awake -> sets up any per page resource (usually session/user based -> select template for this user, open a db conn)
respond -> deal w/ specific page request. If there is an action execute it, otherwise run writeHTML
sleep -> close down any per page resources (close db conn)
So you respond to a HTTP GET/POST. That response will usuall be to execute some code and then write a string.
So my action is just a part of the repond phase
-Aaron
I suppose that rather than keep complaining, I should make a proposal. ;-)
------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss
------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss
