On 12/11/02 11:41 PM, Luke Palmer wrote: >> More generally, I really don't want to have too many (any?) "system" object >> method names squatting in "my" all-lowercase object method namespace. It's >> not hard to think of many kinds of objects that would naturally have an "id" >> attribute, but must now have "foo_id" and "bar_id" methods because the >> (probably rarely used) "id" method from UNIVERSAL (or whatever it is today) >> is hogging it. > > I'd argue that you'd better pick a better name than .id anyway. You > wouldn't use .foo_id and .bar_id, you'd use .descriptor or .index > (though that one's not too much more descriptive than .index). I'd > say .id should be kept short and sweet, because it's going to be used > on a wider variety of objects than your database .id.
I use the "id" attribute of my database objects much more often than I compare object identities. IMO, "common" method names like "id" should be in the user's domain, to be used as is applicable to each kind of object. -John