Daniel Massie

Greenhorn
+ Follow
since Jan 08, 2005
Merit badge: grant badges
For More
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 Daniel Massie

They wouldn't be able to sit the test as identification is required.
I handled the interupt scenario by allowing a number of attempts at locking and when the maximum number has been reached a runtime exception is thrown which wraps the original exception. The runtime exception is thrown from the data class whenever an unrecoverable exception is thrown such as IO or an interrupt. These exceptions can't be rethrown as a RecordNotFoundException as that has a specified cause thus making the runtime exception the best option.
I know that the book covers integration with various Java web frameworks and also covers various AJAX toolkits. Is the same example application implemented using each of these different approaches and is the ease with which they are developed compared?
It also covers libraries such as DWR, AjaxTags and Script.aculo.us.
Whatever option you choose, make sure you document it in your choices document.
Which then means that its not only your data class (and any classes that it delegates to) that knows that its a file based implementation.
Sorry if that was confusing, I just meant a method that you would call when the application was shutting down.
If you create an extension to the provided database interface, you could provide a shutdown hook which will close the file. You'd then reference this new interface throughout the application rather than the provided one.

Originally posted by Oricio Ocle:

If Data class implements the interface the requirement is fulfilled, does not matter if data clients interact through the interface or directly to the implementation, IMO.



I think you'd be marked down if you interact directly with the implementation as its bad practice and bad design to do this rather than using references to interfaces.
I'm not so sure about that. My instructions state:
"4 byte numeric, magic cookie value. Identifies this as a data file "

To me that says that the value should be checked.
I'd agree with that, if its not stated in the instructions, its not a requirement. Therefore if implemented, its not a specified feature, just something that you thought would be useful.
If you have a JTextField for the user to enter the search criteria, "" will always be the value when the user does not enter a value for that field. I went with the option of disregarding "" values in my GUI and therefore making it a null when it makes its way to the find method.
To determine whether the database file specified by the user is valid or not.
Your Data class can implement other interfaces, but I'd seriously question whether or not you need to. The example method which you provided could be contained within your 'URLyBirdHotelClass' since it is a method specific to its implementation where as the DBMain interface is pretty generic.