Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Implementing the required interface

 
Roy Mallard
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • 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?
 
Oricio Ocle
Ranch Hand
Posts: 284
Debian Firefox Browser Netbeans IDE
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic