Ideally the addResult() would not perform the redirect itself, but instead
flag the framework to perform the redirect immediately after the controller
method call has returned. That way, any processing that follows the
addResult() would still occur, but none of the event processing that
normally follows the call would be performed.

I've developed a practice of putting a return call after every addResult()
call in a Model-Glue controller method, regardless of whether the result
will trigger a redirect. That way I'm less likely to be caught by the change
in behaviour should I change the redirect setting of a result.

-- Dennis

On 27 July 2011 23:38, Chris Blackwell <[email protected]> wrote:

> Sean,
>
> It's always stuck out for me as a bit of an oddity too. The attribute name
> is misleading to say the least.  As it implies that if that named result is
> added that you will be redirected to it, not that processing of further
> results will be halted.
>
> Out of curiosity, if you could change it, how would you do it?
>
> Chris
>
>
>
>
> On 27 July 2011 03:18, Sean Corfield <[email protected]> wrote:
>
>> On Tue, Jul 26, 2011 at 10:49 AM, Irvin Wilson <[email protected]> wrote:
>> > It does - mostly.  I guess I had in my head that, using security
>> > functions as an example, the controller would be designed to do
>> > whatever verification desired and then, if failed, jump to cfreturn
>> > and return whatever values set, including any result messages.  The
>> > way it works seems fine to me though.  I just couldn't figure out why
>> > half my controller function was not executing.  I'll certainly fix
>> > what I have to work within the framework.
>>
>> As a long-time Model-Glue user (since the 1.0 days, back when I was at
>> Macromedia and used Model-Glue for an ERP integration app), I have to
>> be honest and say I've never liked this dichotomy. Here's why:
>>
>> function someControllerMethod( ... ) {
>>    if ( someCondition ) {
>>        ...addResult("foo"); // what does this line do?
>>    } else {
>>        ...addResult("bar"); // what does this line do?
>>    }
>>    ...
>> }
>>
>> Without knowing whether the result is declared with redirect="true",
>> you cannot tell, just by looking at that code what it does. Its
>> behavior is tightly coupled to another part of the system in a
>> non-obvious manner: the two near identical lines could have completely
>> different behaviors.
>>
>> Pretty much impossible to change this now, due to backward
>> compatibility, but it is one of the few design decisions in MG's
>> history that I wish had a different outcome...
>> --
>> Sean A Corfield -- (904) 302-SEAN
>> An Architect's View -- http://corfield.org/
>> World Singles, LLC. -- http://worldsingles.com/
>> Railo Technologies, Inc. -- http://www.getrailo.com/
>>
>> "Perfection is the enemy of the good."
>> -- Gustave Flaubert, French realist novelist (1821-1880)
>>
>>

-- 
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en

Reply via email to