Last night I thought all of the efforts here and couldn't find a real-world reason to develop a Query Component.
Yes, CF doesn't support stateful query objects, so a simple iteration component might be necessary for some operations. But QueryIterator and QueryComponent are different things. And I thought the beginning of this QueryIterator concept...: John was thinking mistakenly that I want ASP-style recordsets in CF. No, it's not true. Also ASP died currently and ASP.NET's DataTable object doesn't have moveNext etc. Methods. This means Microsoft changed ASP to simulate CF ;) So what do we need? What are we doing? - I just wanted to have stateful query objects to iterate on using UI custom tag to simulate CF table. - I don't want ASP or ASP.NET-style coding. I'm definitely sure current style of CF is better. - I might want some functionalities of ASP, ASP.NET or PHP but not same objects and methods, this is a different thing from above. What do we need? - CF already have the functionalities of iteration (stateless or explicit), granular processing, sorting, filtering, etc. All of them is possible in CFScript, but some (like sorting and filtering) may need helper functions since <cfquery> tag is not supported in CFScript. This means some of us may need a function library for some tags that are not supported by CFScript. - Again, we sometimes may need stateful (or implicit) iteration to add remembering functionality to our queries without storing an index variable explicitly - which may decrease confusion when we work with more than one queries, also this can help data passing since we won't have to pass index variable. Do we need ASP-style recordsets? No, I like CF. I cannot see a reason to use ASP-style recordset objects since ASP recordsets support more unnecassary methods and concepts and CF has all of the required functionalities of ASP except stateful iteration. Now, I think we may need only a QueryIterator component nothing more. Murat. > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Benjamin Pate > Sent: Friday, February 25, 2005 3:24 AM > To: CFCDev@cfczone.org > Subject: Re: [CFCDev] query object CFC Beta > > I hate it when people do it to me, but I'm going to do it to you, > John. I always post some awsome code, and people immediately start > asking for enhancements -- instead of letting me bask in the glory of > the accomplishment. Sorry. ;) > > I've used techniques very similar to this for dealing with flat files, > grid controls, etc. I would typically just use <cfoutput> except for > when I have to deal with more complicated features like paging, > sorting, filtering, and especially grouping. I hate having to rebuild > this kind of complicated logic each time. So for these, I've always > wanted to use a library that would efficiently handle the harder tasks > in a standard way. > > I think it comes down to this. This discussion has already been down > the route of: "why don't you just use <cfoutput>." And there are many > good reasons that you might want to build an enhanced iterator > control. But, without making the iterator itself TOO big and clumsy, > it is good to really differentiate your library by adding features > that you just cannot do without a whole lot of effort. Once you > confirm that you have a solid working set of code, I believe that it > is these extras that will make it worth your time to choose the > enhanced (but admittedly slower) library over the base features built > in to the language. > > What I'm suggesting is to build in some way for your query iterator > class to be able to traverse queries in more complicated ways than > just 1 -> RecordCount. For example, 1) I want to process all items in > this query, but I want to specify one or more fields to "group" on, > and I want some special alert to be raised if this is the first or > last element in the group. Or, 2) I'd like to traverse this query, > but only process items that match some criteria I've specified. And, > 3) I know that we can re-order tables using query-of-queries, but > since we're going to all this trouble to build a query iterator, it > would really be nice to include that functionality as well. Or, 4) > you could add a MOD 2 calculator that would tell me if I'm on an odd > or an even row. > > Looking at your list of functions to be added, I see that you're > already thinking along the same lines, with sorting and filtering > features planned for the future. I suggest that you consider adding > some additional functions such as these: > > SetGroupColumn() -- sets the column that the iterator will group on > IsGroupBegin() -- true if this record has a different group column > than its predecessor > IsGroupEnd() -- true is this record has a different group column > than its successor > IsOddRecord() -- true if this record is odd > IsEvenRecord() -- true if this record is even > > > -- > > Benjamin Pate > http://smartcms.tigris.org > > I have 3 GMail invites for anyone who's interested. > > ---------------------------------------------------------- > You are subscribed to cfcdev. To unsubscribe, send an email > to cfcdev@cfczone.org with the words 'unsubscribe cfcdev' as > the subject of the email. > > CFCDev is run by CFCZone (www.cfczone.org) and supported by > CFXHosting (www.cfxhosting.com). > > An archive of the CFCDev list is available at > www.mail-archive.com/cfcdev@cfczone.org > > ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to cfcdev@cfczone.org with the words 'unsubscribe cfcdev' as the subject of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com). An archive of the CFCDev list is available at www.mail-archive.com/cfcdev@cfczone.org