Rick Lu

Ranch Hand
+ Follow
since Mar 25, 2003
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rick Lu

1. Did you wait on lockManager(if you had one) or on the record in lock method?

My locking mechanism is on record-level. Only those clients who works on same records have to wait.

2. And did you use notfiy or notifyAll in the unlock method?

I used notifyAll here. But actually notify should be also OK. I don't remember exactly. But one article said that notify is preferred. This is not worth 40 scores, right?
I also did stress testing. Everything seems good. Why?
19 years ago
My Score: 354
General Considerations (maximum = 100): 96
Documentation (maximum = 70): 70
O-O Design (maximum = 30): 24
GUI (maximum = 40): 40
Locking (maximum = 80): 44
Data store (maximum = 40): 40
Network server (maximum = 40): 40
I still don't why I only get 44 out of 80 in Locking (like some others). IMO, the locking should be perfect.
19 years ago
Any one can tell me whether JDK 1.4.1_01 is good to submit in this week? Sun says "must not have been superseded by a new production version for more than 18 months".
Is it ok? Thanks

When I close the window by clicking the X at right-top corner, the window closes even I don't add a window listener,why?

You need to check the method "public void setDefaultCloseOperation(int operation)" in JDialog. That will help.
Hi Dave,

I'm curious if anyone here has decided to write their database contents to file when the database is being closed.

IMO, it should be written to the file. To my understanding, SUN just view this flat file as the database. Thus, I did it.

I tested writing my database's contents to a temp file using RandomAccessFile's writeXXXX methods,

The file is store on the disk as bytes. So, I guess you like to make sure this presentation before writting it to the file. Hope this helps.
Hi Jim,
Sun serializable FAQ says the serialization is stream-oriented, just found it.
And there is a way to know whether objects are serialized or not: using writeObject and readObject in the class which implments serializable interface.
Thanks for your reply. Now, I can use it without violating SUN's instructions.
Regards, Rick
Anyone can tell me whether the serialization is strem-oriented or not? That is, the stream will decide the object is serialized or not, right? Thus, in local mode, no seriablized objects will be created.

Note also that nothing is actually serialized in local mode; the class just implements in interface that says it's OK if you do serialize it.

Is that true whether the object is serialized or not is automatcially controlled by required streams? I don't undertand this interface well becuase it only needs a interface marker, no method
Thank you, Jim.
Hi Jim,

No, it is serializable. You can try omitting this declaration initially, but eventually rmic will complain that it can't create a stub class for a Remote interface if a return value or parameter type isn't Serializable, or a primitive type.

If you did serizlize the MetaData, then you cannot call this class in local mode because SUN don't allow call any serializable objects in local mode. Is that ture?
Thank you guys. I uses RMI actually, but kind of lost in Serializable.

This fact that this object is Serializable enables me to return it from my RemoteDataImpl in RMI, but in local mode this is irrelevant. I just call getMetaData() and get the object.

This is exactly what I am asking for. The class MetaData is not serizliable? You did it only in RemoteDataImpl right? How can I do that? Thanks
I want to expose MetaData, used by Data.java, to clients, which I have to implement serializable interface. But SUN also said in local mode, it should be no any serialization of any objects. I don't know how to expose this object now! ( must need LocalMetaData & RemoteMetaData right? sounds too complex )
Another choice is to directly expose method instead of Object. But this seems not so OO.
Any suggestion for this ? Is there any simple and efficient way to do so???
Hi Paul,

Given the above, it will probably be my final design decision that the client only support one view of the data. So this means I shouldn't be using MVC, correct? Sure, I should work to separate business logic from view logic, etc. etc. but it's my understanding doing so is just adhering to good coding practices, and not really implementing the MVC pattern.

I think MVC is good for most applications becuase it allow kind of loose relationshiop between the model and views, no matter how many view, even only one. Sun also addressed

Your user interface should be designed with the expectation of future functionality enhancements.

I suppose this implies MVC pattern. But of course, if you are uncomfortable with this pattern, just make your choose.
Regards, Rick
Hello Bharat,
Thank you so much. That's exactly what I ask for.

When you are ready to upload your project, you won't have to worry about how and where to include this file and also since the grader's machine and set-up most likely will be so different that yours that it doesn't make sense to include it in the first place (thanks Andrew).

Yes, my program will create a property file when there is no such one.
Hi Chris,

I agree with you that there are no need for default values.

Sorry, maybe I didn't write it clear. My question is not only about default values. Actually, I want to know when we should use values in the property file.
As the dialog always popups, there seems the values perviously stored in the properties will neven be used! Do I need to ask user "whether you want to open last database you previously worked on?"? Any suggestion on this?
Thank you. Rick
I am working on the client GUI. One tricky to me is that where to load values from the property file???
This is how my client gui work:
At the client side, there are two possibilities: �standalone� and nothing for network client. A dialog box will start. For �standalone� a textfield where the user can type in the location of the db-file; for the empty mode flag two textfields for the hostname and the port-number. Then, the dialog-box is closed and the GUI-client opens.
So, there seems no need to load persistent values because the dialog box always popup, right???
Thanks. Rick
[ November 07, 2003: Message edited by: Rick Lu ]