i think calling object 'boolean' and arguments 'value' while may/may not
be valid CFML is still not a good idea.
good code should read like a book (not an interesting one, but one that
you can at least follow the plot line without getting cofused), when you
have to think to much about what you mean by 'domain object boolean' vs
returns boolean etc etc it makes debugging that much harder.
id recommend re-thinking your variable names then take a fresh look at
the code.
one thing also to try is when you call super.init() pass the arguments
as named arguments.
ie. super.init(value=arguments.value) ...thats why you get arguments.2
when you pass it up the heirarchy, the struct looses its names.
Pat
Taco Fleur wrote:
I have some CFCs that extend like the following
YN extends Boolean
Boolean extends Type
Type extends Property
Object
-----Property ( has init() )
---------- Type ( does not have init() )
--------------- Boolean ( has init() )
-------------------- YN ( has init() )
When I instantiate the object YN and pass the argument “arguments.value”
the following “Y”
Arguments.value is not passed to super!
If I do a dump of arguments.value before we call super.init() in *YN*
the argument is there, which is fine because its passed to that object.
If I do a dump of arguments.value before we call super.init() in
*Boolean* the argument is undefined, which is fine.
*Type* does not have an init() (but if I add one and do a dump the
argument is still undefined), so the init() method of *Property* is
really called by *Boolean*.
This is where it gets weird, if I do a dump of arguments.value before we
call super.init() in *Property* it tells me that the value of
arguments.value is “String”, exactly that “String”!.. And this is not
because I have forgotten to put hashes around the argument ( dump(
arguments );abort(); - don’t worry these methods are present in the parent )
I went through the final object Object to see if that had any arguments
called “value” that was set to “String” but nope!
What is going on here?
I searched the whole project for every occurrence of “String” to see if
that value was set anywhere, and the answer is no.
There is a cfargument
<cfargument
name="value"
type="any"
required="no" />
in the init method of the object *Property* but as you can see its set
to required=”no” and there is no value passed to it from the sub class.
Now it gets even weirder, if I remove the above argument and still dump
#arguments# the value argument is gone but instead it says there is an
argument named “2”…..!!!**
Of course people are going to say “value” is a reserved word, but I
couldn’t find it on the reserved list unless I looked at the wrong list??
________________________________
Taco Fleur - /E-commerce Development Manager/
Shelco Searches & Services
An Authorised ASIC Information Broker
www.shelco.com.au
Ph: + 61 7 3236 2605
---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/