Hi Barry,

I don't think there is anything wrong with a collection at all. It may be a
(fairly trivially) amount of extra work to populate if you're populating
from a database, but as long as you've got a reason not to use a query or
some kind of bean then go right ahead.

The OO purists will probably raise the issues inherent in providing access
to data without encapsulating the access using getter methods, and the
performance purists will quibble about the clock cycles you'll lose looping
through a query to populate the collection, but if there is a reason
(compatibility with flash remoting, avoiding queries as a public data type
or just the fact that you don't LIKE queries) then go for it!

Interesting information on C#, BTW. Thanks!

Best Wishes,
Peter

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Barry Beattie
Sent: Tuesday, May 30, 2006 9:11 PM
To: [email protected]
Subject: Re: [CFCDev] Opinions on One-To-Many representation in OO


what you say is true.

in fact a query would be in some cases a better datatype for this beause of
the ability to use a Query'o'query internally for simple wrapper fuctions
for a get{child data}ById(), ByType(), ByName(), etc.

the only reason about array'o'structs was the compatability with Flash
remoting and the total removal of queries as a "public" datatype.

part of this is translating what we're doing with C# back to CF. One of the
limitations with C# is that, while a DTO may contain a dataTable to hold
child data, querying that (eg:
myTable.Select("id=5")) returns an array of data rows. But if you get the
child data from a DataTable origionally, you cannot get another DataTable as
the result of a select, unlike using a query of queries to get another
query.

but my question still stands. what's wrong with a simple "collection"
datatype for child data?




On 5/31/06, Brian Kotek <[EMAIL PROTECTED]> wrote:
> It still just doesn't make any sense to me to translate a query into 
> an array of structs, when a query essentially IS an array of structs 
> already. There would be a definite cost to do this, and what would be 
> the benefit? Is there something I'm missing?
>
> Thanks,
>
> Brian
>
>
> On 5/30/06, Barry Beattie <[EMAIL PROTECTED]> wrote:
> >
> > something simple: an array of structs, not full blown objects.
> >
> > eg: student ValueObject
> > ==========
> > name: string
> > dob: date
> > timetable: array'o'structs.
> >
> >
>
>  ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email to 
> [email protected] 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/[email protected]


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] 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/[email protected]





----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] 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/[email protected]


Reply via email to