Mark Brouwer wrote:
One could say that for both EventRegistration and ServiceRegistration
(implemented by com.sun.jini.reggie.Registration) the resource it
represents is covered by the associated Lease and as such there is no
need for ReferentUuid to be implemented by Registration at all, but
nevertheless it has been decided so. It is even so that when looking
at the code I see that equals of Registration delegates to the lease
which seems to confirm what I believe is the case.

As such I would have expected EventRegistration to have an
equals/hashCode as well and to find it normal to have it (a subclass of
course) to implement ReferentUuid.

The difference is simply that EventRegistration was designed to just
be a simple local struct, not a proxy; perhaps the best indicator is that
it's a class, not an interface.  Whereas ServiceRegistration is an
interface, with remote methods.

Currently in Seven I have a subclass of EventRegistration that has an
additional reregister method (performs a remote method call) and it
implements RemoteMethodControl.

OK, there was no expectation of that being done.

Maybe I didn't make that clear but I was referring to those objects for
which it is assumed the primary interface is part of the platform, such
as can be assumed for Lease and TransactionParticipant, etc. similar as
that ReferentUuid must be in a Platform to make it work too.

I think that presents a problem when person A designs the service
and person B independently decides what is in his/her platform.
Having a semantic asymmetry between platform and non-platform
services also seems a bit odd?  But probably more to the point:

This will at least return false in case you compare the main proxy and
administration proxy (assuming it doesn't implement Administrable) even
while their Uuid as returned by getReferentUuid() are equal.

I believe it was intentional when using ReferentUuid for equals that
it's only testing for "same remote resource", not "functionally equivalent
proxy" or "role equivalent proxy".  Main proxy and admin proxy are
both proxies for the same top-level service, so they have the same
ReferentUuid; ServiceRegistration and Lease are both proxies for the
same service registration, so they have the same ReferentUuid.

- Bob

Reply via email to