Thanks for the input everyone: Nando - Why am I doing this?
I have a couple of place where I need it - but at the moment it's primarily for managing a Observer/Observable pattern. Because Observer can be any object (that implements a standard method), when you go to remove a Observer from an Observable object, you need to be able to compare 2 CFC instances to see if they are the same Objects and you can therefore remove it. Hence the need for an .equals or equivelent. The idea for a BaseComponent to create UUID - I think this is bad for 2 reasons (1) you now have very stong coupling over a inheritence structure (2) This Event structure is meant to be able to handle any CFC that is passed in a defines the given method, that includes CFCs not written by me. Having a generic base CFC severly limits that. A much more interesting, and far less coupled approach to doing this (and I would probably do it if the hashCode way wasn't working) was actually to assign UUID to the Object via a Mixin when it was added as an Observable, along with appropriate getUUID() and isEquals() methods. When then checking to see if two objects where equal, first it would check to make sure the getUUID() exists (if not, it's not equal) and then compare the values. Finally, Patrick - checked the URL http://pmcelhaney.weblogs.us/archives/22 It gives me a connection refused error... is that the right URL? Thanks! Mark On 19/10/05, Jim Davis <[EMAIL PROTECTED]> wrote: > > -----Original Message----- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf > > Of Hal Helms > > Sent: Tuesday, October 18, 2005 11:40 AM > > To: [email protected] > > Subject: RE: [CFCDev] Easy way to check if oneCFC == twoCFC? > > > > I have a BaseComponent that creates an objectID (a UUID) for all objects > > during objectcreation. Then I have an isEqual method in the BaseComponent > > that compares objectIDs. > > That's exactly what I do. > > The ID also useful in those cases where you want to lock access to the > instance (you can use the ID as a lock name). > > Jim Davis -- E: [EMAIL PROTECTED] W: www.compoundtheory.com ICQ: 3094740 ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com). CFCDev is supported by New Atlanta, makers of BlueDragon http://www.newatlanta.com/products/bluedragon/index.cfm An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
