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
For me, I would probably pass AgeOfMajority into my service component and have it return an "isMinor" column. If that wasn't a possibility, then I would have my page controller add that column to the query.

I would also have an "age" column in the query returned from the service (assuming it was in the fieldlist).

I like a clean view with no method calls.

Steve

--
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