• 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

Implementing the required interface

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My delete() method has the side effect of unlocking the record, which seems reasonable to me but there is nothing to indicate that it should (or shouldn't) do that in the original comments for the method.

My find() method declares that it throws RecordNotFoundException, but it never actually throws it. If there are no matches I return an empty array.

Also my Data.java is designed so that each client is given its own instance to use. If multiple threads share the same Data.java instance the behaviour will be unpredictable since I don't synchronize all the methods.

Could someone please tell me if this meets the specifications?
 
Ranch Hand
Posts: 284
Netbeans IDE Firefox Browser Debian
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Roy

My delete() method has the side effect of unlocking the record, which seems reasonable to me but there is nothing to indicate that it should (or shouldn't) do that in the original comments for the method.


I also think this is reasonable.

My find() method declares that it throws RecordNotFoundException, but it never actually throws it. If there are no matches I return an empty array.


In my assignment (UyB1.2.1) this could (is not an explicit must) lead to an automatic failure.
Literally in my specs:
Any methods that throw RecordNotFoundException should do so if a specified record does not exist or is marked as deleted in the database file

Also my Data.java is designed so that each client is given its own instance to use. If multiple threads share the same Data.java instance the behaviour will be unpredictable since I don't synchronize all the methods


Synchronize them. At least it would seem more robust to the reader.

Regards
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic