> Hi all.
>
[quoted text clipped - 8 lines]
>
> Thanks.
> Note I haven't written the traversal code, need whatever help I can
> get with that. Thanks again.
Your problem definition is incomplete.
How would you treat this (omitting access modifiers):
class SelfReferential
{
string s;
SelfReferential ptr;
}
SelfReferential one = new SelfReferential();
SelfReferential two = new SelfReferential();
SelfReferential three = new SelfReferential();
one.ptr = one;
two.ptr = two;
three.ptr = one;
one.s = two.s = three.s = "some string";
Which of the above should compare equal?
>> Hi all.
>>
[quoted text clipped - 8 lines]
>>
>> Thanks.
Chris Bordeman - 18 Mar 2008 21:17 GMT
These are all fairly simple business objects. That situation would not be
supported to self references would be simply be ignored. But the rule is
that the strings and value types must equal eachother in value, not
necessarily be the same object.
>> Note I haven't written the traversal code, need whatever help I can
>> get with that. Thanks again.
[quoted text clipped - 33 lines]
>>>
>>> Thanks.
Rene - 18 Mar 2008 22:31 GMT
> But the rule is that the strings and value types must equal eachother in
> value, not necessarily be the same object.
So I am assuming that these business objects do not override "Equals" right?
Otherwise, this looks to me like the perfect job for "Equals".
Chris Bordeman - 19 Mar 2008 18:11 GMT
Correct.
>> But the rule is that the strings and value types must equal eachother in
>> value, not necessarily be the same object.
>
> So I am assuming that these business objects do not override "Equals"
> right? Otherwise, this looks to me like the perfect job for "Equals".