Changes to web flow action proposal

Cantor, Scott cantor.2 at osu.edu
Wed Apr 17 18:59:20 EDT 2013


On 4/17/13 6:38 PM, "Tom Zeller" <tzeller at dragonacea.biz> wrote:
>
>I too think that the doPreExecute() method makes Actions more readable.
>
>Why is Action readability related to scope ? Maybe I am misreading.

Because to make them readable, the code in doPreExecute() has to have some
place to put the results it produces. The three obvious places are:

- local instance variables (which requires a scope of "not singleton")
- the profileRequestContext (which Brent and I don't like)
- Spring WF or Servlet request attributes, which is transport/Spring
dependent

Using scope="prototype" enables the first option without making much
impact on how Web Flow works. It just creates a lot of objects and they
get GC'd instead of creating one and reusing it for every flow request.

>I have a feeling that doPostExecute() will not be used much.

I don't think so either, but it was symmetrical, and it allows the option
of having doExecute() produce data stored off in local instance variables
and then using doPostExecute() to actually push that data into the
profileRequestContext, which is an additional way of isolating
functionality into separate spots.

>In Action.do[Pre|Post]Execute(), I wonder how throwing Exceptions
>which are caught by the AbstractProfileAction for logging and Event
>building would look, especially in regards to Javadoc.

I stuck with the assumption that we wanted to probably use
Events/EventContext more than exceptions, but that all needs more study. I
also wondered if maybe we want to catch ProfileExceptions and take the
final part of the class name, lowercase the first letter, and use that as
the event name.

-- Scott




More information about the dev mailing list