Hi, I have modified the original data interface that was given in my assignment, basically, by making throwing more general exceptions. I did this because I needed my Data class and my RemoteData class to implement thesame data interface (this way the GUI does not care which implementation it is working with - network or standalone).
My question is, Is this allowed, are you allowed to modifiy the given data interface in any way?
as far as I understand, it probably would be possible to let RecordNotFoundException inherit from IOException, as long as it is well motivated... for example, FileNotFoundException also inherits from IOException.
Actually, I am planning to extend both Exceptions appearing in the interface from a common parent (not IOException), because both indicate a database problem.
This makes life easier when it comes to the remote calls, and adds an extra layer of abstraction from the concrete implementation.
Just another idea... As said before, DO NOT change the DBMain interface. If necessary, make your own exceptions as RuntimeExceptions. Runtime exceptions do not require change your interface, because they do not have to be declared in the method throws.