Hi all,
I wondering if it is possible to get the address of a Coldfusion object? Its reference as I can get it in java.
I'd like to compare two objects (two CFC instance) with the same content. I'd like to be able to determine if two object with same value inside are the same instance of the CFC. Is it possible to do that in coldfusion and how can I do that (I'd like to do it without altering the content of the instance of the cfc)?
Thanks in advance for your help,
Best Regards,
Yves Prignon
CFC Reference / addressNo answer? I suppose it is not possible then?
CFC Reference / addressNot in ColdFusion no.
But ColdFusion just builds Java, so I presume since you can get an objects reference in Java,?then you should be able to get the reference to the objects built by the CFML code.
But I would have no idea how that would work.
Thanks a lot for you answer Ian. I still can't get the reference but I'll just alter my object, if it is altered in every reference then it is the same instance of the object (same pointer to the object in memory). I don't really like to do that since I've to alter my object but whatever, CF is not made for that anyway.
My errors where coming from the fact that CF is using equals to compare the content of two objet. So I can have two object with the same content but not at the same address in memory. Two distinct instance :s altering one will not alter the other but somtime it change everywhere (depending on where my variable point to, i've no way to find out where it point)
I tried with tostring(myobj) it is only working with simple?value same for javacast and myobject.tostring() doesn't exists.I can't get my hand on the reference of the object. Not sure anybody has ever needed to use object reference in CF, there might be a simple answer.
My errors where coming from the fact that CF is using equals to compare the content of two objet. So I can have two object with the same content but not at the same address in memory.
-==cfSearching==- wrote:
What code were you usingto compare the objects and for what purpose (debugging)?
Granted CF objects all reduce down to some java object. But I am not sure how to access the underlying references with CFC's. I do remember seeing this old thread on the subject.?(Unfortunately the old forums seem to have vanished into the void).?It is several years old, so I do not know if anyone ever came up with a better option.
http://www.justskins.com/forums/criticism-of-cfcs-and-the-so-called-debugger-674 35.html
I just tried a quick search and I could not find it.?But I do remember reading some material, I'm nearly positive written by Hal Helms, that discusses a work around to do this type of compairson without diving into the java.?It wasn't exactly the same thing as a true comparison of an objects reference, but I think his point was that it was close enough 98% of the time.
I wish you better luck with your search kungfu if you choose to try and find it.
Here is some of what I remember reading from Hal Helms.
http://www.adobe.com/devnet/coldfusion/articles/oo_coldfusion.html
Thanks you Ian, that helps a lot
Not exactly what I was searching but it will solve my problem.
I flagged you answer as best.
Thanks a lot for your help, both of you
Here is some of what I remember reading from Hal Helms.
?/p>
http://www.adobe.com/devnet/coldfusion/articles/oo_coldfusion.html
Oh, that must be the Hal Helm's technique that was vaguely mentioned in the earlier link. Thanks for finding the full article. I will have to bookmark that one!
No comments:
Post a Comment