Kaz Yosh

Ranch Hand
+ Follow
since May 22, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kaz Yosh

Hi all,

Here's more specific question.

If there are only lock and unlock method in the DB interface, how can I make readlock and writelock?
Thanks.
Hi all,

Please, some one tell me how the Lock Manager works.
Thanks.
Hi

Should we have six textfields to input criteria or just two for those name and location?

-Kaz
Hi Daniel,

First I made Data class singleton by making Data class instance variable static but later I changed to only RandomAccessFile singleton. The reason why I did this was that only RandomAccessFile should be protected. I might be wrong. What do you think?

-kaz
Thanks for the reply again,

I felt little confident and got confused again in the last couple of minutes.

You said,

Data class provided access to your data. All you really want is the data to be sent over the network - not the entire file access class. So Data class would not normally be made serializable, nor would it be sent over the network.



If the Data class handles the data, does that mean the Data class represents data? How could I send data over the network without data class? I don't understand how I could send the data.
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 ]
I've just finished coding for data retrieve and now I'm moving towards data locking. The first question I came up with was that how I could implement read-write lock if there are only lock() and unlock(). I was trying to use Adapter patter for this but got nowhere so far. Any suggestion?

Thanks
Please, tell me where to use what design pattern. I studied GoF design pattern and I understand what they are but I'm not quite sure how they are applied.

Thanks.
I passed SCJP a year ago and just purchased SCJD assignment.
Where should I start?
I'd like to join that sesseion. I'll take an exam next month too. Currently, I'm reading SCWCD exam study kit. Let me know if you guys find something interesting to study.
where do you guys think is the best UNIX/Linux server?
19 years ago
Hi all,
I wrote "hello world" servlet code. Now where should I put this file? I use freeBSD and tomcat is located under /usr/local
19 years ago
ok
That was the last question of my exam. I guess I was right on that. Oh well, I don't know where I'm going from here.
What happens if I implement both run and start methods?
Is run method ever called if I call start method as usual thread invoking?
I think this is all about timing thread scheduler decides. and it all depends on the JVM. I tested the code with assertion on java 1.4 on Mac OSX and java 1.4 on Win XP. and result is different. What is your environment?