Hi Kumar,
Welcome to JavaRanch and this forum.
Interface RemoteData extends Remote and has the methods
getData
searchRooms
bookHotelRoom
Why do you have both business logic methods (searchRooms & bookHotelRooms) and access to the low level methods (via getData) exposed to your client? Most candidates seem to go one way or the other. The either have just the high level business methods, or the low level access to Data class.
The GUI client calls DataFactory.getRemote(). This method does a look up on the server, casts the return to RemoteData, and returns getData i.e a new Data object.
Why are you calling the getData method? Shouldn't you be returning an instance of RemoteData which will then have the business methods?
Also, the Data class has local RAFs in its methods for I/O and RAFs are not serializable. So the client should not receive the Data object, I think.
Agreed.
Should RemoteData extend both Remote and DBAccess? Is it absolutely necessary for it to extend DBAccess.
You will probably find that RemoteData cannot extend both interfaces, as DBAccess probably does not throw the "right" exceptions for you.
(Which is a round about way of saying that it shouldn't extend both).
From the DBFactory, should the client get the RemoteData object itself and not Data?
Yes.
Regards, Andrew