• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading the db.db

 
christy smile
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Rangers,
I have a question about reading the db.db. Are we supposed to read the routine to read the flight infos from db.db? I have written that part of the code in Data.java, are we supposed to change that file?
Thanks.
Christy
 
Ian B Anderson
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
"I have a question about reading the db.db. Are we supposed to read the routine to read the flight infos from db.db? I have written that part of the code in Data.java, are we supposed to change that file?"
You can modify the Data class or extend it depending on your design choice. In the spec you are only required to add lock(), unlock() and criteraFind(). (And replace deprecated methods). So all the other methods would probably be used but not modified.
Good luck
Ian
 
christy smile
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But the data.java does not really provide any search function besides searching depending on the Flight number. Should I add the search functions in Data.java or just extends it and add more functions to it?
Thanks
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
criteriaFind() adds those searching facilities; it's up to you to decide whether it should go into Data.java itself or not. Ditto for the locking implementation.
One hint: in the interest of optimum reusability, keep the Data class itself free of any network- or multi-user related fluff. Networking is best factored into another class (or set of classes).
- Peter
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic