Hi, I have got B&S problem which basically search contractors(search DB) and book one of them(Update DB). And UI requirement says that I must search data with some conditions or not, book a selected record and update file accordingly.
But in Data.java there are two methods that are not going to be used, I think. public void delete(int recordNo) public int create(String  criteria). As far as I know, the interface Data.java must be implemented.
Does it means I must implement those methods even if I do not use it? Or Shall I implement all expected related DB action in UI like create a record when a new contractor joins this company or delete a record when a contractor doesn't work any more??
I implemented both create(String) and delete(int, long) in Data.java, but my UI does not use them at all.
Your data access class must be called Data.java, must be in a package called "suncertify.db", and MUST implement the following interface...
To me, this means that all the methods in the supplied interface must be implemented.
As far as the UI is concerned, I did not provide the ability to add/remove contractors. It is simply not in the specifications, and going beyond the requirements could be a bad thing.
Also, here is another possible justification for implementing create and delete in Data.java, even though these methods are never used by the UI. Perhaps, in the future, someone will want to write another program for an administrator to use to add and remove contractors from the database. This isn't necessarily something a customer service representative should be allowed to do. By implementing create and delete, this new program could simply use your Data class as it is.
Anyway, that's what I think. Hope this helped.
B.S. University of Wisconsin<br />SCJP 1.4 (85%)<br />SCJD 1.4 (92%) B&S Contractors
I recommend to keep the implementation within the scope of the requirement: Let create and delete throw an UnsupportedOperationException. Make sure you document the interface ("optional operation") and the implementating class appropriately.
For me it payed off (no points lost in related areas) as well as for everyone else I heard about (2 or 3 ppl). I had B & S 2.3.2.