Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!

Leo Tien

Ranch Hand
+ Follow
since Sep 10, 2002
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 Leo Tien

Thanx all:

By Omar

What is next?

I don't think this deeply, because my work is too busy. I like SCEA, perhaps it will be next.

And you?
13 years ago
Hi, Paula:

I have the B&S assignment, and I thought that the Data class could only throw DuplicateKeyException, RecordNotFoundException, and SecurityException. I don't think we can add a new exception, in your case: DataAccessException. I want to add a similar new exception, but do not know how to fit it in with the required design. Currently, my Data class, which accesses the file, is eating the IOException. I want to change this, by wrapping the IOException in a DatabaseException, but how can the new exception be thrown without violating the requirements?

Thanks for any input.

Like you said after, my DataAccessException is a unchecked exception, it will be caused and unwrapped to IOException in my logic layer.
I work with URLyBird 1.3.1 over one year, today I receive my test score:

Grade: P
Score: 354
Comment: This report shows the total 1.4 SCJD points that could have been awarded in each section, and the actual number of points you were awarded. This is provided to give you per-section feedback on your strengths. The maximum possible score is 400; the minimum to pass is 320. General Considerations (maximum = 100): 99 Documentation (maximum = 70): 70 O-O Design (maximum = 30): 30 GUI (maximum = 40): 31 Locking (maximum = 80): 44 Data store (maximum = 40): 40 Network server (maximum = 40): 40

I passed !!

Of course, I want to thank all friends here, especially, Andrew, Philippe., without your help, I cann't get this.

Good luck, everyone, don't give up, lads.
13 years ago
Hi Paula:

I call lock/read/update/unlock sequence in my logic layer. In it, I use try..catch..finally to solve your problem.

This is same as use it in database connection, you should do con.close() in finally block.

Do you think?
Thanks Peter, I will do my best to understand your code, but now, I will use my code yet, I'm not obstinacy, because your code is more complex.

In the assignment it said that

A clear design, such as will be readily understood by junior programmers, will be preferred to a complex one,...

I think I'm a junior programmer, but I don't understand your code , so I will use my code and will write some word into choices.txt: "In my idea, I don't think about DST, because the assignment didn't tell me clear and in my country don't use it at all.".

Excuse me my foolish act, because it's what I can do
Thanks Peter again.
Hi peter, thank you for your reply.

I think I don't understand your code fully,

This will not work properly over the end of year, try it next week.

I test my code in 2004/12/31, it can book the room '2004/12/31' and '2005/01/01' and '2005/01/02'. It seems enough.

Solutions involving 86400000 will not work properly over the change to and from daylight saving time.

I don't understand it, because in my country there isn't daylight saving time.

I use the Excel format since its easy to validate the conversion. The conversion is not valid for years before 1582 or after 4000. There are much better versions of this algorithm available that account for the year which the Gregorian calendar was adopted and for the adjustments after the year 4000.

I don't think this so deeply, it's so strange to me.
I think whether you mean I should convert my date to days number. Such as

and then I use days to compare??
I hope I don't waste your time.
Sorry Nicholas, I don't know this, this is very very very bad news. He is a good teacher, is good friend, ......

I want cry.....
I'm very very sorry heard this news, Philippe, I will remember you for ever.
13 years ago
Can someone give me some advice??

Where's Andrew, where's Philippe..
I made the mistake so much, I think I'm confused on time. So I give up the time, and modify my new code.

As you can see, I give up all the time and clear my idea, you can book the room during current date and current date + 2.

What do you think...
I think about the 48 hours rule again, at last get this new idea:

Because the date field don't support time, so I think '2004/12/22' equals '2004/12/22 00:00'. So, in order to 48 hours rule, you can do book within '2004/12/20 00:00' and '2004/12/22 00:00'. But, you should allow the customers to book the current day room, so the time scope is modified to '2004/12/20 00:00' and '2004/12/23 00:00'. In other words, date-2 < now < date+1.

So, I modify my code as following:

It's OK? Give me some advice please.
Hi Omar:

At the second question, I will agree with you.

At the first question, I want get more advice here.

Hi Omar:

Thank you for reply.

I think it is always better to be in the safe side, hard code your default data.

Yes, but hard code will meke the code ugly and reduce the application persistence, so I think this way.

So I think allowing rebooking, is a bit risky as business logic

I agree you here again. But these are a lot of thread talk about it, and someone don't support this and get a high score, like Ken. So I confuse here whether we should implements this limited. If yes, why we must implement it?

Hi all:

first question - properties file: I have a properties file(not, include some default value for my program, such as column number, host name(the first run this program, after this, will read the data from, port number(same as pre)...I don't support any GUI to edit it, because it needn't edit(if I hard code these value in some class, it work too). I don't know whether this break the assignment rule -

all properties must be set through a GUI


second question - To now, I'm not sure whether you can book a room has been booked. I lean to not, but I remember Ken has told us he allow that. He said our application should allow the CSRs to modify the book room if they take some mistakes or someone don't want to book the room any more. I think since the assignment don't tell us the booked room mustn't be booked again, so we can leave it alone and don't take care it. What do you think?

Please tell me your idea, thanx, thanx a lot.