I'm an occasional user of iterators.
I have a query that involved joins on several tables because data from those
tables is needed inside the <cfoutput query in the View. Logic started creeping
into the View as the query was looped.
ie
<cfoutput query="qGetXXX">
<cfif qGetXXX.thisBoolCol>
<cfset valueToDisplay = qGetXXX.aNumericCol * qGetXXX.anotherNumericCol>
<cfelse>
<cfset valueToDisplay = qGetXXX.aNumericCol + 1 />
</cfif>
</cfoutput>
I want to use the Iterator so the logic is taken out the view but I get the
performance benefit of query instead of bean array.
My question is about the complexity of the bean and apologies if it isn't the
best explanation I give!
The data returned in the query is from several tables but only one or two
columns may be used. I have simple beans for most of the tables involved in the
joins.
Should I
a) Create a complex bean with associations to the other beans ie beanA has its
own properties but is composed of a BeanB and BeanC even though I only need one
property out of BeanB and 2 from BeanC.
b) create a new bean specific to what the page / query is doing ie have a
BeanD with properties of all the display data I need where I can still use
getters to provide the encapsulation I need.
My thinking is a) is a more elegant solution and more reusable but I need to do
more work to build the bean in my bean factory and also bring more data out of
the db and b) is quicker, leaner but I have little chance of reusing it
elsewhere in the app.
Any thoughts? Especially from users of Iterators / IBO's
Alan
________________________________________
From: [email protected] [EMAIL PROTECTED] On Behalf Of Rob Brooks-Bilson
[EMAIL PROTECTED]
Sent: 03 July 2008 22:47
To: CFCDev
Subject: [CFCDEV] Re: Porn galleries and hardcore adult pics in many categories.
Guys, if this keeps up, I'll turn on moderation. For now, it seems
like this is an isolated occurrence on this list, no?
-Rob
On Jun 24, 8:42 am, "Stephen Moretti" <[EMAIL PROTECTED]>
wrote:
> I just changed the Scottish CFUG google group to moderate new members...
> :( Sad times.
>
> 2008/6/24 Brian Kotek <[EMAIL PROTECTED]>:
>
>
>
> > If someone posts a message with the word porn in it, I'd say just ban them
> > immediately. This is becoming common on all of the unmoderated Google lists.
>
> > On Tue, Jun 24, 2008 at 7:52 AM, Mark Drew <[EMAIL PROTECTED]> wrote:
>
> >> I thought this was a discussion like "How to do high load image
> >> serving applications in CF"
>
> >> But I guess its just spam.
>
> >> Time to ban this fella?
>
> >> MD
>
> >> On Tue, Jun 24, 2008 at 12:47 PM, geourgious <[EMAIL PROTECTED]> wrote:
>
> >> > Porn galleries and hardcore adult pics in many categories.
>
> >> > ... Sex ....
>
> >> --
> >> Mark Drew
> >> Blog:http://www.markdrew.co.uk/blog/
> >> LinkedIn:http://www.linkedin.com/in/mdrew
>
> --
> Stephen Moretti
> Blog :http://nil.checksite.co.uk/
> Twitter :http://twitter.com/mr_nil
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---