Hi there
It's been a while, I am stuck in this problem for almost a week now
and hope you guys can help me out. I am implementing a socket based solution, and in a previous
thread, some fellows suggested me a brilliant idea regarding server-client communication thru the use of command
Pattern. Everything went fine until I was struck by this!? Let me explian the problem clearly so you can get better understanding of what I am up against. It won't take long time..promise
My client controllers don't care whether it's serving a local or remote client:
All the load lies on the ContractorServices argument which is in fact an interface that describe the services contract:
public interface ContractorServices {
public void book(int recNo, String id) throws AlreadyBookedException,
ContractorNotFoundException,IllegalAccessException,
ContractorServicesException;
//more services methods
I also have default implementation of this interface:
Things looked good, until I finished coding my RemoteContractorServices class. This class open a socket connection to the server, hence it has the potential of throwing IOException(s) of it's own, which are far from being related to the business logic, I considered coding remote GUI controllers that are simply duplicates of the local controllers but have the capability of cathcing IOException. However, I thought this will increase the number of unnecessary classes and may violates these must requirements as well:
Architecturally, this mode must use the database and GUI from the networked form, but must not use the network server code at all
and
Your user interface should be designed with the expectation of future functionality enhancements, and it should establish a framework that will support this with minimal disruption to the users when this occurs
That's why I chose to keep my controllers intact:
Currently, I dealt with this problem. but I am not sure if represents good OOP and good exception handling strategy:
Please help me out, I can't go further and worsen the situation
Thanx in advance
Hatim