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.
Hi, My DBInterface has the following methods: ... public String read(int recNo) throws RecordNotFoundException; ... public int find(String criteria) throws RecordNotFoundException;
When a search is to be made based on a criteria, I can do the following: (a) call the second method, retrieve all the record-nos that match the criteria (b) use the first method to read all the matching records If 10 records match the criteria, then 11 request (1 search + 10 request data) has to be sent to the server. To reduce the network round-trip, I would like to introduce another method in the db interface. Has anyone changed the dbinterface before? and is it ok? Introducing this method, might make the given methods in the DBInterface not very useful ! is this ok? The new method would return something like a "Value Object" design pattern. Dayanand.
You can modify the Data class or extend it, as you wish (just say why you did one or the other). In order to use RMI, the return object must implement Serializable, which most API objects (including arrays) do- so just return an array from your find method.
Fly by Night Consultants<br /> <blockquote><font size="1" face="Verdana, Arial">quote:</font><hr><i>I climbed on the back of a giant albatross<br />which flew through a crack in the cloud<br />to a place where happiness reigned...<br />all year 'round<br />the music played ever so loudly!</i><p><a href="http://thomasfly.com/songs/Traffic/Hole_in_my_Shoe_qt.htm" target="_blank" rel="nofollow">Hole in My Shoe</a><hr></blockquote>