Hi,
I've re-worked my question to be a little smaller in size
(I am not overly comfortable understanding diagrams yet,
and because I want to become more conversant in using
them, is one reason I rephrase my question).
Question: Is the design which I am about to diagram
pretty standard in its usage? Does this design have
a pattern name or is it too common to have a pattern
name? I am not asking whether
the design will work or not (i.e., is it actually feasible--
though I think it most probably is--since I'll find that
out when I implement it).
This design addresses the client-side. The client is
getting a service object, and regardless of whether
this service object is networked or non-networked,
the client wants to refer to the same reference type
which in this case is IndependentInterface.
At this web site is an overview figure of rmi5:
http://www.geocities.com/eosrubiginosa The idea is that the client will declare g1 as
an IndependentInterface type and then assign
it in one of two ways:
For the following text-diagram, any reference type with "Interface" in its
name is a
Java interface. Otherwise, it is a class.
GenImpl implements the following interfaces: Remote, Serializable.
where MyException extends RuntimeException,
but I may have made an error above by saying
that it
must extend RuntimeException
instead of Exception (I'll look into that again).
The methods signatures, except for the exceptions they throw, are identical
in the following interfaces and classes: all of the above (i.e.,
G, CommonInterface, IndependentInterface, GenRemoteInterface, and GenImpl).
So, conceptually, to mitigate between the two implementations, G and GenImpl
which throw a non-intersection set of exceptions, you create
IndependentInterface which encompasses both, different sets.
The client code to catch exceptions handles the individual exceptions thrown
from IndependentInterface, even though if this reference type refers to a G
class, there never will be a RemoteException thrown, and likewise, if this
reference type refers to a GenImpl class, there never can be a MyException.
However,it just occurred to me that since G and GenImpl do the same things,
then it would make sense that G and GenImpl should both share the throwing
of MyException, but I won't change the diagram above until I test the toy
server/client code.
Thanks,
Javini Javono