Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!

Alex Rhodan

Greenhorn
+ Follow
since Sep 17, 2005
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 Alex Rhodan

Hello Thomas,

thanks for your apply. I felt a little bit lost the last two days. *lol

There are a couple of things to consider here

What happens when you have booked the wrong room for a client (in the future) and have to change the record, do you first have to unbook a room?



Yes in future. Now i want to keep this as simple as it is. This means the client can only book a record.

What happens when a mistake has been made in the past and now has to be changed? (what happens with the 48 hour requirement?)



As i said above. An unbooking or changing the customer id i doesn't want to implement in order to keep thinks simple. @Andre: Is it a problem?
The 48h hour rule is also in my buissness layer which means i have a check in both buissness methods find and book to solve the requirement.


What happens when you are trying to book a room someone has just booked? (Optimistic Locking scenario)



As you can see my book method has a boolean return value. In every book operation i check this with an read method from the Data class.

But this isn't really my problem. I try to describe it again.

Consider the following code in my find method:



So and my problem is now that i dont know what to do with the RecordNotFoundException because i doesn't want to change my method signature (i.e. throws RecordNotFoundException). The cause it that if i chain it to the gui layer then i have the problem in this layer. Because i can't prompt the user with a message like "In your find request record 5 has a problem".
The only approach which make sense to me is to throw an RuntimeException.

How would you handle this?

Thanks in advance
alex
Hello,

[URLyBird1.1.1]
I'm currently working on my buissness tier and have a question of handling the RecordNotFoundException.

My Service interface currently contains about the following signatures:



And now? My book method uses the update method from the database which throws RecordNotFoundException.

I can change the signature to throw the RecordNotFoundException to the representation layer. But i think that the RecordNotFoundException is the right exception for the next tier.
Another choice is to handle this exception, but here i don't know what to do. Because i can wrap it into IOException but really don't know if this is good style. And if i doesn't want to wrap it what can i do because i can't eat the exception.

The next problem in this context is the find method where i put in the code for checking if a record is already booked.

Thanks in advance.
alex