In what way?

-----Original Message-----
    From: "Dakota Jack"<[EMAIL PROTECTED]>
    Sent: 3/8/05 12:34:50 AM
    To: "Struts Users Mailing List"<user@struts.apache.org>, "[EMAIL 
PROTECTED]"<[EMAIL PROTECTED]>
    Cc: "Corey Probst"<[EMAIL PROTECTED]>
    Subject: Re: why complicate? was: Eliminate Setup Actions
    
    Isn't this all a bit contrary to the rightfully hallowed principles of
    decoupling in OOP?
    
    
    On Mon, 07 Mar 2005 22:56:23 -0500, Frank W. Zammetti
    <[EMAIL PROTECTED]> wrote:
    > Corey Probst wrote:
    > > Another thought, what about redirecting forwards?
    > 
    > I'm glad you brought that up because I didn't think of it, and wouldn't
    > have until after someone noticed it :)
    > 
    > I don't think there is anything that can be done about that, at least
    > not in the case where you redirect to a JSP.  If you redirect to an
    > Action Mapping (even if it's just an ActionForward), then sure, the
    > setup could still work there.  But redirect to a JSP I don't see a way
    > to make it work.
    > 
    > On your other point... I'm actually thinking about allowing the setup
    > elements to be at the mapping level and/or the forward level.  The idea
    > being that there may be times you want to do some particular setup
    > functions regadless of which forward is choosen, and other times where
    > you want to do specific setups for specific forwards only.  I'm thinking
    > that each setup element you add to a forward can specify whether to
    > process any mapping elements IN ADDITION to those of the forward, or
    > don't use the mapping elements.  For example:
    > 
    > <action path="myAction" type="com.omnytex.actions.MyAction">
    >    <setupItem class="com.omnytex.setup.MyActionSetup"
    > method="setupMethod1" />
    >    <forward name="defaultForward" path="page1.jsp">
    >      <setupItem class="com.omnytex.setup.MyDefaultSetup"
    > method="defSetup1" />
    >    </forward>
    > </action>
    > 
    > In this case, when the defaultForward is selected,
    > MyActionSetup.setupMethod1() would be called, followed by
    > MyDefaultSetup.defSetup1().
    > 
    > But, in this case:
    > 
    > <action path="myAction" type="com.omnytex.actions.MyAction">
    >    <setupItem class="com.omnytex.setup.MyActionSetup"
    > method="setupMethod1" />
    >    <forward name="defaultForward" path="page1.jsp">
    >      <setupItem class="com.omnytex.setup.MyDefaultSetup"
    > method="defSetup1" additive="false" />
    >    </forward>
    > </action>
    > 
    > ...only MyDefaultSetup.defSetup1() would be executed when defaultForward
    > is selected.
    > 
    > Also, I think ideally I'd make the setupItems attached to the mapping
    > executed BEFORE the Action's execute() is called, but clearly the
    > forward-level items would have to execute AFTER execute() completes.  I
    > think that gives even a bit more flexibility to it.
    > 
    > I'm making this up as I go, so feel free to comment :)
    > 
    > --
    > Frank W. Zammetti
    > Founder and Chief Software Architect
    
    

[Message truncated. Tap Edit->Mark for Download to get remaining portion.]


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

Reply via email to