Skip to Content.
Sympa Menu

mace-opensaml-users - RE: SAMLNameIdentifier.equals

Subject: OpenSAML user discussion

List archive

RE: SAMLNameIdentifier.equals


Chronological Thread 
  • From: "Scott Cantor" <>
  • To: "'Tom Scavo'" <>
  • Cc: "'Chad La Joie'" <>, "'OpenSAML'" <>
  • Subject: RE: SAMLNameIdentifier.equals
  • Date: Fri, 13 Jan 2006 12:47:08 -0500
  • Organization: The Ohio State University

> A class is free (even encouraged) to override equals. Regardless of
> whether or not there's an equals method in SAMLObject,
> SAMLNameIdentifier would have to override it because of the Format
> attribute.

Right. But your way of doing it isn't the one that everyone in the world
would agree with. Having a single definition of equality doesn't work, which
is why C++ algorithms and containers don't use one.

> So in that sense it doesn't matter if you override
> Object.equals in SAMLObject. On the other hand, by overriding equals
> in SAMLObject, you provide a default method of comparison that most
> likely works "as is" for most subclasses.

In my view, I did that (by leaving the default). You just don't agree with
my default, which isn't based on XML serialization equality. And that would
be stupid, since any number of serializations are in fact the same. But if
you don't agree with my choice, why do you believe everyone else will agree
with yours? I'm just suggesting you consider the implications.

> I'm not sure what you mean by "block". Every class has an equals
> method, you can't escape that.

No, but you can prevent people from overriding equals() and creating a new
contract for equality where none was meant to exist.

-- Scott




Archive powered by MHonArc 2.6.16.

Top of Page