Doesn't 
 <cfreturn Duplicate(variables.permissions) />
work?

-- 
Eric C. Davis
Programmer/Analyst II
Georgia Department of Transportation
Office of I.T. Applications
Web Applications Group
404.463.2860.199
[EMAIL PROTECTED]


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of John Temm
Sent: Friday, April 02, 2004 11:12 AM
To: [EMAIL PROTECTED]
Subject: [CFCDev] Protecting private Array variables using get/set


Hi
I have a CFC with a property "varaiables.permissions" that is an array
of permission objects. I have built methods to add and remove permission
objects to/from this array which enforce the 'type' of the array, and a
'getter' which returns the whole array.  The problem I have is that
since getPermissions() returns a reference to varaiables.permissions,
not a copy, a developer could skirt my addPermission method and insert
say, a string into my typed array. I don't see an ArrayCopy native
function (akin to StructCopy). The arrays are generally very small so
creating a copy with a loop won't be a big performance hit, but... it's
ugly.

Ideas? Is it generally not a good idea to use arrays for properties
because of this?
-Chip Temm
[EMAIL PROTECTED]
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words '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 words '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]

Reply via email to