Please comment this
The public methods of Data class can not be transformed in a remotable interface without modification. In order to be remotable, an impletentation of this interface must declare RemoteException on all methods. When implementing "DataInterface" the compiler will complain if I introduce a new checked exception (RemoteException) that existing clients might not be aware of.
My design was based on preserving compatibility with existing clients. Thus, I created RemoteDataInterface with all public methods of the original Data class, declaring RemoteException to each one. I also created RemoteConnection class, implementing RemoteDataInterface, wich is an adapter to the DataInterface. RemoteConnection keeps an instance of the Data class, delegating all method calls to it.
If I were not concerned with keeping compatibility with existing code I could make it simpler. Actually, I have not been told to act this way, but, I am assuming that I will be tested on making this kind of judgement, wich is "real life".
Is it Overdesign?
Do you think I should just create DataInterface with remotable methods and dont bother about this?
thanks
The public methods of Data class can not be transformed in a remotable interface without modification. In order to be remotable, an impletentation of this interface must declare RemoteException on all methods. When implementing "DataInterface" the compiler will complain if I introduce a new checked exception (RemoteException) that existing clients might not be aware of.
My design was based on preserving compatibility with existing clients. Thus, I created RemoteDataInterface with all public methods of the original Data class, declaring RemoteException to each one. I also created RemoteConnection class, implementing RemoteDataInterface, wich is an adapter to the DataInterface. RemoteConnection keeps an instance of the Data class, delegating all method calls to it.
If I were not concerned with keeping compatibility with existing code I could make it simpler. Actually, I have not been told to act this way, but, I am assuming that I will be tested on making this kind of judgement, wich is "real life".
Is it Overdesign?
Do you think I should just create DataInterface with remotable methods and dont bother about this?
thanks