• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Interface implementation B&S

 
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??
     
    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
     
    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:
    https://coderanch.com/t/189353/java-developer-SCJD/certification/JUnit-Test-Cases
     
    catch it before it slithers away! Oh wait, it's a tiny ad:
    Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
    https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!