Rather than just reconsidering the rule, you might simply replace it
with "no multi-term expressions in the view".  Not a viable goal in
all cases, but pretty darn close.  Views shouldn't have logic apart
from that directly concerned with the view structure (looping rows in
a table, conditionally displaying an action button, etc.).  All the
dynamic values and conditional expressions should be single terms
(often - usually? - a method call):

#person.getAge()#
not
#dateDiff('yyyy', dateOfBirth, now())#

<cfif person.isMinor()>
not
<cfif person.getAge() GT AGE_OF_MAJORITY>

cheers,
barneyb

On Fri, Jan 7, 2011 at 2:10 PM, Peter Bell <[email protected]> wrote:
> On Jan 7, 2011, at 4:46 PM, Steve Bryant wrote:
>> and of being able to have a rule for "no method calls in the view" which 
>> helps to avoid inadvertent calls to looping code from within an output loop.
>
> That's pretty much the opposite of how any OO app works. ALL of them are 
> based on calls in the view to both business objects and view helpers. If you 
> had no method calls in the view in Rails or Grails, you wouldn't have an 
> application at all.
>
> Personally, I'd reconsider that rule.
>
> Best Wishes,
> Peter


-- 
Barney Boisvert
[email protected]
http://www.barneyb.com/

-- 
You received this message because you are subscribed to the Google Groups 
"CFCDev" 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/cfcdev?hl=en.

Reply via email to