I am working on a B&S assignment and wonder if anyone has done any assumtions similar to the one I'm thinking of.
The description of the User Interface states that it MUST satisfy the following criteria:
It must be composed exclusively with components from the Java Foundation Classes (Swing components).
It must allow the user to search the data for all records, or for records where the name and/or location fields exactly match values specified by the user.
It must present search results in a JTable.
It must allow the user to book a selected record, updating the database file accordingly.
My interface that MUST be implemented consists of the following methods:
public String  readRecord(long recNo)
public void updateRecord(long recNo, String data, long lockCookie)
public void deleteRecord(long recNo, long lockCookie)
public long findByCriteria(String criteria)
public long createRecord(String  data)
public long lockRecord(long recNo)
public void unlock(long recNo, long cookie)
I'm thinking, in my terms implementing an interface doesn't neccesary mean implementing logical code to the methods. The gui, or any describable must-functions, don't require the delete method or the create record to be functional. I'm thinking than on assumtion then can be that these function is handled by e.g. another application not communication with the assignment application. What considerations has other people here done with this aspect??
If you read through the old post some of them left these functions blank and some have given functionality as they thought nothing wrong in doing extra work. Ones who left blank have a reason as not required.
I think you MUST implement the inteface completly.
f.e. in the B&S assigment you must implement the delete method even if you don't use it, since all the methods of the Data class(class implementing DB inteface) could be(i am allmost sure that they will be) automatically tested.
In real live, a reason for implenting unused methods, is that it should be used by another system or this functionallity could be added in the future. Another reason is that implemeting an inteface you should allways fullfit the contract.
Take care about this. I would test these methods as much as aplication used methods.