Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Interface implementation B&S

 
Anita S�rensen
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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??
     
    uzma ali
    Ranch Hand
    Posts: 56
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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 hope it helps

    Uzma
     
    Xabier Martija
    Ranch Hand
    Posts: 40
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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.

    Take a look at this post.I found it very usefull:
    http://www.coderanch.com/t/189353/java-developer-SCJD/certification/JUnit-Test-Cases
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic