Differences between revisions 1 and 2
Revision 1 as of 2007-11-26 15:55:19
Size: 2040
Editor: blueice2n1
Comment: Added equals() issue to API Review
Revision 2 as of 2009-09-20 22:48:50
Size: 2040
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

Overriding equals(Object) for logical equivalence

We need to implement logical equivalence checking of WSDL components to support the spec, Part 1, Section 2.15 Equivalence of Components http://www.w3.org/TR/2007/REC-wsdl20-20070626/#compequiv

We would like to do this by overriding the java.lang.Object.equals(Object) method so that the Woden implementation can reuse the Java collection classes - for example, List.contains(Object). We should also document on the Woden API what equals(Object) means in Woden.

The problem is that the Woden WSDL object model represents both the WSDL Component model and the WSDL infoset. It's possible that two equivalent Components could be derived from different WSDL infosets, which raises a question about what the equals(Object) implementation should do. Check for component equivalence only and ignore infoset equivalence? Collapsing the Component and Element APIs into a single WSDL API will not eliminate this question - we still have decide the behaviour of the equals(Object) implementation.

Woden currently has a temporary, partial equivalence checking solution via the Component API method equals(WSDLComponent) declared on org.apache.woden.wsdl20.WSDLComponent. The default implementation of the equals(WSDLComponent) method is the object reference checking inherited from java.lang.Object.equals(Object). Only InterfaceImpl overrides this behaviour, with partial support for Interface component equivalence (it does not yet compare the faults and operations of the two Interfaces). This is adequate for the existing test suite, but it is not a complete solution.

A discussion with proposals is underway on the woden-dev list (started 21 Nov 2007). See the subject "Re: Woden API Review wiki page" in the mailing list archives (click 'Thread' to see the full thread):


FrontPage/Woden/APIReview/OverridingEquals (last edited 2009-09-20 22:48:50 by localhost)