Thanks for the replies, Peter, Anton and Andrew
I want to ask you guys more specific questions but I can't cause I'm really confused with all the aspects that I have to implement. So I'll try to explain what I've done so far and what I'm trying to do next. I'll ask question along the way. In my Data class, which implements DB interface, I use RandomAccessFile to retrieve data from a flat file provided by Sun. I made RandomAccessFile static and made Data class constructor private so that I can make sure there should be only one RandomAccessFile. I use createInstance() public method to create this object if and only if there's no instance available, otherwise, just return the reference. As Anton mentioned, I noticed that this isn't enough to protect RandomAccessFile under muti threaded environment. Next thing I want to do is to store the data retrieved from a file to somewhere so I can reuse it later. I'm thinking about making an inner class called Contractor, by the way, I'm doing Bogditt and Scaper, within Data class and use Vector or ArrayList to store contractor objects. My first question is that if I should put this contractor class outside the Data class. I know in the later time, I'll have to make data class serializable in order to transfer it over the network. Could this be a bad if I put a contractor class within the data class? Another question for anton, you said you hid classes behind interfaces. What does this mean and how did you do that?
Thanks in advance.
[ November 17, 2004: Message edited by: Kaz Yosh ]
[ November 17, 2004: Message edited by: Kaz Yosh ]