Re: cfproperty default attribute is buggy
On Saturday, Aug 30, 2003, at 18:50 US/Pacific, S. Isaac Dealey wrote: Well afaik cfproperty models (to some extent) the way properties are declared in other OO languages like Java -- Nope, not really. Unless you are writing a Web Service and using cfproperty for additional validation of returned component instances, cfproperty does nothing beyond creating metadata. It has no relation to instance data and the default= attribute does not have an impact whatsoever on the values of that instance data. My advice: don't use cfproperty. it'd be nice to get the expected functionality from the tag The problem is that your expectations are incorrect. cfcomponent cfproperty name=foo type=numeric/ cfset this.foo = I am not numeric / /cfcomponent That's perfectly valid CFML - by design. Sean A Corfield -- http://www.corfield.org/blog/ If you're not annoying somebody, you're not really alive. -- Margaret Atwood ~| Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm
Re: cfproperty default attribute is buggy
On Saturday, Aug 30, 2003, at 18:50 US/Pacific, S. Isaac Dealey wrote: Well afaik cfproperty models (to some extent) the way properties are declared in other OO languages like Java -- Nope, not really. Unless you are writing a Web Service and using cfproperty for additional validation of returned component instances, cfproperty does nothing beyond creating metadata. It has no relation to instance data and the default= attribute does not have an impact whatsoever on the values of that instance data. My advice: don't use cfproperty. it'd be nice to get the expected functionality from the tag The problem is that your expectations are incorrect. cfcomponent cfproperty name=foo type=numeric/ cfset this.foo = I am not numeric / /cfcomponent That's perfectly valid CFML - by design. Ahh okay... well that changes a lot. :) ... But the case still stands -- the reason for using cfproperty in the first place was largely for documentation -- to have / get the meta data in other wordes... So... I still need it for what I was doing... s. isaac dealey972-490-6624 team macromedia volunteer http://www.macromedia.com/go/team chief architect, tapestry cms http://products.turnkey.to onTap is open source http://www.turnkey.to/ontap ~| Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Get the mailserver that powers this list at http://www.coolfusion.com
RE: cfproperty default attribute is buggy
Well afaik cfproperty models (to some extent) the way properties are declared in other OO languages like Java -- and while it may not be absolutely necessary to use cfproperty in a CFC in order to set local variables, what I'm working on right now is an application architecture that includes code documentation dependant on the ability to get property information from the getMetaData() function. Which means if I don't use cfproperty I can't apply the documentation. Granted that all of these defaults would show up in the documentation as [runtime expression] anyway, which isn't much more useful, but it'd be nice to get the expected functionality from the tag and not have to write a cfset for any cfproperty that needs a runtime expression as a default value. Isaac, Isn't CFProperty mostly for documentation at the CFC level, and doesn't actually create any variables? Use CFArgument to declare and default arguments in methods and CFSET instance.FOO=StructNew to declare private properties. Andy -Original Message- From: S. Isaac Dealey [mailto:[EMAIL PROTECTED] Sent: Saturday, August 30, 2003 2:14 PM To: CF-Talk Subject: cfproperty default attribute is buggy Has anybody else on the list seen this behavior: CFMX 6.1 - certain values can not be used in the default attribute of the cfproperty tag: cfproperty type=struct default=#structnew()# produces error Complex object types cannot be converted to simple values. cfproperty type=array default=#arraynew(1)# produces error message 5 cfproperty type=string default=#request.mystruct.mycustomfunction()# produces error Method mycustomfunction with 0 arguments is not in class coldfusion.runtime.CFPage cfproperty type=string default=#getbasetemplatepath()# produces error message 7 Also, simple values are allowed when type indicates a non-simple value, i.e. cfproperty type=struct default= which should produce an error In all cases, I've been able to use cfset further down in the cfc to set the property to the desired default value... but I'd really much rather have a proper default. thanks, s. isaac dealey972-490-6624 team macromedia volunteer http://www.macromedia.com/go/team chief architect, tapestry cms http://products.turnkey.to onTap is open source http://www.turnkey.to/ontap ~~ ~~~| Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubsc ribe.cfm?user=633.558.4 Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm s. isaac dealey972-490-6624 team macromedia volunteer http://www.macromedia.com/go/team chief architect, tapestry cms http://products.turnkey.to onTap is open source http://www.turnkey.to/ontap ~| Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm
RE: cfproperty default attribute is buggy
Isaac, Isn't CFProperty mostly for documentation at the CFC level, and doesn't actually create any variables? Use CFArgument to declare and default arguments in methods and CFSET instance.FOO=StructNew to declare private properties. Andy -Original Message- From: S. Isaac Dealey [mailto:[EMAIL PROTECTED] Sent: Saturday, August 30, 2003 2:14 PM To: CF-Talk Subject: cfproperty default attribute is buggy Has anybody else on the list seen this behavior: CFMX 6.1 - certain values can not be used in the default attribute of the cfproperty tag: cfproperty type=struct default=#structnew()# produces error Complex object types cannot be converted to simple values. cfproperty type=array default=#arraynew(1)# produces error message 5 cfproperty type=string default=#request.mystruct.mycustomfunction()# produces error Method mycustomfunction with 0 arguments is not in class coldfusion.runtime.CFPage cfproperty type=string default=#getbasetemplatepath()# produces error message 7 Also, simple values are allowed when type indicates a non-simple value, i.e. cfproperty type=struct default= which should produce an error In all cases, I've been able to use cfset further down in the cfc to set the property to the desired default value... but I'd really much rather have a proper default. thanks, s. isaac dealey972-490-6624 team macromedia volunteer http://www.macromedia.com/go/team chief architect, tapestry cms http://products.turnkey.to onTap is open source http://www.turnkey.to/ontap ~| Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm