it depends on if you're storing a list of addresses (addr1, addr2, ...) , or if it's a set of keyed addresses (home addr, work addr, ...).
For the first, I'd use an array or write a collection CFC named 'ArrayList' that stores a list of "things". I'd recommend the latter, since dealing with lists of objects is a common enough task that you'll probably end up using it quite often. That way you can easily swap out the array-based implementation and throw in an linked list (or whatever) if you need to down the road. If you're storing keyed addresses, then you need a map of some kind (which a CF struct is) so just put them in there under keys such as 'work', 'home', etc. You could certainly write a custom CFC to wrap this task up in an object as well, but I see less of a need. The main objective in either case is to have a single item which represents the collection of addresses, rather than having individual addresses floating around. A collection is an object, so it should be treated as such. cheers, barneyb > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Behalf Of Justin Balog > Sent: Friday, October 03, 2003 11:46 AM > To: '[EMAIL PROTECTED]' > Subject: [CFCDev] Multiplicity > > > > > Howdy, > > I am curious how folks out there are handling multiplicity in their cfcs. > Lets say I have a person cfc. A person can have multiple addresses (for > arguments sake lets just say there are addresses, not home address, work > address, etc.). How would you handle a cfc instance var being composed of > multiple cfcs? Right now I would add a new struct key to a > variables.instance.addressStruct each time an address is set in the person > cfc? I will bet there is a much better way to do it =) Let me > know if you > need any more information. > > Thanks, > > Justin > ---------------------------------------------------------- > 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]
