• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Better to implement all functions or keep it simple?

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone, I am working on the Bodgitt and Scarper Project and I�m at the point where I could use some of your kindly advice.

Mainly for the purposes of testing my code I have implemented fully functioning methods for all methods listed in interface DB.

public String[] read(int recNo) throws RecordNotFoundException;

public void update(int recNo, String[] data, long lockCookie)
throws RecordNotFoundException, SecurityException;

public void delete(int recNo, long lockCookie)
throws RecordNotFoundException, SecurityException;

public int[] find(String[] criteria);

public int create(String[] data) throws DuplicateKeyException;

public long lock(int recNo) throws RecordNotFoundException;

public long lock(int recNo) throws RecordNotFoundException;

I also have a lot of extras, such as sorting and filtering of data in the Jtable, data validation methods for updating and creation as well as other functions designed for user friendliness and making the application somewhat robust.


While my understanding is, at a bare minimum the functions for searching and booking along with the need for locking and unlocking are the only functions that truly need to be fully implemented.

My question is this, is it better to summit my project with all methods fully implemented or would it be wiser to only implement what is truly required. My fear is that there may be errors in the non required methods that would result in points be taken off.

Would it be acceptable to comment out the code in the non required methods and document that these methods may by serve the purposes of future functionality by uncommenting the code at some point in the future.

I would appreciate any comments you could pass along to me.

Thank you.
Phil
 
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Phil,

My question is this, is it better to summit my project with all methods fully implemented or would it be wiser to only implement what is truly required. My fear is that there may be errors in the non required methods that would result in points be taken off.



Good question. Till very recently, anybody on this forum would have replied something like: "All methods defined in the Data interface *must* be implemented, even those not used by the business layer". Because the instructions are clear enough: you must *implement* a provided interface.

But a first "guinea pig" submitted an assignment with an UnsupportedOperationException thrown as the only "implementation" of the create and delete methods and he ... passed. I even think that another "guinea pig" dared the no-implementation-at-all solution and passed too.

But does it really help? Each assignment is graded by one particular grader, and the fact that a given candidate passed with a given solution will never be a good argument to defend yourself in case of failure.

So you must make your *own* decision, but I wouldn't take the risk, personnally.

Regards,

Phil.
 
reply
    Bookmark Topic Watch Topic
  • New Topic