This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have a general design question which i need to pose here.
I have 3 layers in my application a client/gui layer a business layer and a data layer.
The business layer contains methods which invoke the methods in the data layer.
My question is here is it okay for both the non-network client and network client/rmi client to invoke methods on business methods defined in the business interface whereby the only change i make to this interface for an RMI client is that i just extend the interface.
So my business interface used by the non-network is:
The business interface used by the rmi client is:
The only issue i have here is that the non-network client interface throws RenoteExceptions which it should not since it is a non-network client even though the local client implemntation class doesnt throw RemoteExceptions however the methods in remote interface implementation class does as it should. Is this a problem i should be concerned about?
first off: looks like you changed the interface that Sun gave to you: you added a few Exceptions. Don't do that.
In my assignment: I used the given interface for local access, and made a second interface (copied the given interface), added the Remote exceptions for network-access. I justified the small amount of duplicate code in my decisions-document.
David Winters Junior
Joined: Oct 30, 2007
Yes i changed it briefly during testing an issue but as you said i cannot which is quite right.
Ok i take on board your suggestion but still i think it is okay to do as i did here since the local implementation does not throw these exceptions anywhere in the code. It's a design choice perhaps which is okay. Perhaps i will change it as you should as the interface should not declare such exceptions in its interface.