Adopting the variables.instance convention, i just found it easier to define
variables.instance as a structure rather than a recordset, thereby avoiding
the awkward QueryAddColumn / QuerySetCell syntax when setting instance
values via other means than using a query.
I think that's what Don might have been looking at in the examples he's
seen, but i'm not 100% sure of that. Then of course if you set it up as a
struct, you need to return it as a struct or it will throw an error.
>From Sean Corfield's article.cfc example:
<cffunction name="getInstanceMemento" access="public" returntype="struct"
output="false"
displayname="Get Instance Memento" hint="I return a memento of this
article's instance data.">
<cfreturn variables.instance />
</cffunction>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of sean
> Sent: Friday, November 21, 2003 10:57 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [CFCDev] OOP Newbie needs help developing standard query
> based CFCs
>
>
> Can you clarify why Structs are easier to deal with than Query? Is this
> on a syntax level? What are you using your structures/ queries for?
>
> Just curious
>
> Sean
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
> Behalf Of Nando
> Sent: Friday, November 21, 2003 4:09 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [CFCDev] OOP Newbie needs help developing standard query
> based CFCs
>
> Don,
>
> > B) I'm using query as my returntype but most of you use structs. I am
> not
> > heavy into structs yet, is there an article or info that explains
> > why that's
> > the way to go?
>
> Expert i'm not, but i noticed this as well, especially in Sean's code.
> What
> i have found over the last week or so in practice is that structures in
> CF
> are easier to work with than query sets in some cases. I don't know
> anyone
> else's reasons for sure, but i started returning structures (into the
> variables scope of the cfc as instance data) for this reason.
>
> For the gateway type of query that won't populate the object, the select
> all, select where ... , etc, i'm remaining with returning a query for
> now
> because that will probably will be only used to populate the user
> interface
> with result data ...
>
> That's the way i've sussed it out so far.
>
>
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email
> to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
> in the message of the email.
>
> CFCDev is run by CFCZone (www.cfczone.org) and supported
> by Mindtool, Corporation (www.mindtool.com).
>
> An archive of the CFCDev list is available at
> www.mail-archive.com/[EMAIL PROTECTED]
>
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email
> to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
> in the message of the email.
>
> CFCDev is run by CFCZone (www.cfczone.org) and supported
> by Mindtool, Corporation (www.mindtool.com).
>
> An archive of the CFCDev list is available at
> www.mail-archive.com/[EMAIL PROTECTED]
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]