At 11:41 -0400 10/16/03, Derek Richardson wrote:
Is the PageController going to have an associated ActionForm? When preparing to display a new page, it is often the case that I want to have access to a new action form that I can populate with default values for the HTML form to display. The action form is probably not of the same type as the action form for the previously-executed action, as that action form was having its processing completed, while this new action form is just beginning its lifecycle.

That basic idea (a different form for "on-the-way-out-to-the-view" than the one "on-the-way-in-to-the-controller" is really useful, and we've fudged something like on the current project, but I have to admit that while I've been waiting to get done with my current project and back to doing something about this conversation, it kind of looks like the struts-chain stuff is passing us by.


See Ted's recent post copied in below... I'm definitely going to look at Chain before I invest a lot of energy in a PageController that works as earlier discussions have gone.

Joe


At 5:33 -0400 10/16/03, Ted Husted wrote:
Ted Husted wrote:
I think the Chain package will make it easier for people to do the Right Thing. The ActionForm properties, and so forth, can be commuted to a Context, and the Context passed up to a Chain which can do whatever it is they want to do.

Just to check in ...


I've been refactoring an application that started out using the "page controller" type actions into an architecture that uses "view commands" instead, and it seems to be working well.

In cases where I want to forward directly to the page, I can use a single Command:

    <command
        name="summary"
        className="app.command.SummaryView" />

In cases where I need to do something else first, like look up a seed record or process an update, I can set up a Chain that executes the business operations first, and then runs the view command. For one "interesting" page, I have two chains running back to it, depending on which control is used:

    <chain
        name="summary_select_applicant">
        <command className="app.command.SummaryList" />
        <command className="app.command.SummaryView" />
    </chain>

    <chain
        name="summary_select_permit">
        <command className="app.command.Select" />
        <command className="app.command.SummaryList" />
        <command className="app.command.SummaryView" />
    </chain>

So, in places where I had "business" actions forward to "presentation" actions, I'm now back to having "command" actions forward straight to the server pages again. Life is good.

Ladies and gentlemen, I believe we've found the "missing link" =:)

--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "We want beef in dessert if we can get it there."
-- Betty Hogan, Director of New Product Development, National Cattlemen's Beef Association



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to