Originally posted by Peter Yunguang Qiu:
In my DB access file, I just used RandamAccessFile. I think it is easier than use many stream classes. What do you think of it?
Like you I've just started with the assignment (urlybird 1.3.2), what I've done I first brewed some coffee and put in some long nights just to go through this forum and look at common problems that everyone has/is faced/facing during completion of the assigment.
For example the usage of a randomaccess file, is one of the or more likely the most used solution for db access. Some people cache it some don't (including me). Why? Because I like to keep things simple, I might change my mind in the future but for now no caching.
Using JUnit, it seems need more work than directly test. I just print out the record that been readed, and see by my eyes. It seems simpler and need less work.
This is my first JUnit project and with the testing of the data section i've reaked the benefits (made some mistakes that where easy to mis with simple print statements). If you like to put in print statements thats fine, but it clutters you're code, junit provides a graphic framework that shows you if you're tests succeed or fail. (Green is good and red is Evil) and can be completely seperated with the you're going to submit.
I use Eclipse as my IDE and it comes with JUnit, development could not be easier (except if someone else did it for you ;-) ).
there are some tutorials there and www.eclipse.org
for the IDE.
Well it's back to work for me