Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Data File Question

 
kevin kern
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
My assignment is URLyBird. I have some questions about the Data class, thank you for your help.
1.In the Data class, I can't decide to choose the constructor's parameter between File and RandomAccessFile.
2.If choose the File, then in the class I must new a RandomAccessFile Object, I define it as a Member Variable? or in every method I define a local Variable?
thanks, My Engligh is poor, I hope you can understand what my mean.
 
Wei-ju Wu
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kevin,

the decision is up to you and your implementation. Both File or RandomAccessFile could be appropriate, providing File would express that you want to hide the implementation detail further within your Data class, though.

The choice whether you reference the file in a member variable or as a method parameter is also up to you, the file or at least its location should be stored somewhere, because you need to write and read to it on subsequent calls.
 
kevin kern
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot.Wei-ju Wu,your name seem to like a Chinese?
 
Wei-ju Wu
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kevin,

I was born and raised in Germany, but my parents are chinese immigrants.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic