This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Originally posted by Irene Rodriguez: Hello , I have some doubts about the assignament UrlYbird:
1-My assignaent said the following:
-------------------------------------------- Repeat to end of file: 1 byte "deleted" flag. 0 implies valid record, 1 implies deleted record --------------------------------------------
I understand that the file is composite the following form:
name location .....[0 or 1] this mean that at the end to the records always are a byte that say if the record is valid or not valid , when I read the records , to the end the byte not is read.
You have only quoted the first sentence following "Repeat to end of file:" In the instructions I have, they state:
From the instructions: Repeat to end of file: 1 byte "deleted" flag. 0 implies valid record, 1 implies deleted record Record containing fields in order specified in schema section, no separators between fields, each field fixed length at maximum specified in schema information
So, for my instructions I have a different order to what you have understood from your instructions. Namely, my instructions are telling me that I should have: [0 or 1]name location .....
As always, check your own instructions - it is possible that your understanding is correct, as there are different instructions out there.
Originally posted by Irene Rodriguez: 2-In the interface some methods throws RecordNotFoundException this exception is throws when not find a record indicate ???
Yes. (Is this a yes/no question? )
I know English is not your native language, and I regret that I dont speak more languages. Reading your question above, I think you are asking "In the interface some methods throws RecordNotFoundException - is this exception thrown to indicate when a record is not found?"
Originally posted by Irene Rodriguez: 3-when I do a find in a remote mode is necessary lock a records ???
No. The only time it is necessary to lock a record is when you are modifying it in some way.
When you are reading a record, or performing a find operation, you only need to consider the state of the record at the time you read it. If it gets modified 1 second after you read it - too bad.
Originally posted by Irene Rodriguez: 4-the method SecurityException when is throw???
This is dependant on what your instructions tell you, but typically this is thrown when a client tries to do modify or unlock a record when they do not own the lock.
This is similar to reserving a seat at the cinema. If all seats are reserved, and somebody tries to sit in a seat just because there is nobody there, then management will call security.