Hi everybody, Can somebody help me understand this find method. I see people recommending to use some king of getAllRecord from the database/cache and they seem to say that it is better than going through the method read ( to read the records one by one). But how do they know if the record has been deleted or not? They also still need to read the record anyway to do their searches. So I don't really understand how to avoid reading all the record one by one! May be the solution would be to store all the record in a cache/arrayList or something like that when the database is created? Is this the way to go? The way to do the find (for me) seems to be conected to the use of an cache is it? Can you help me clarify this method I am all confused. Thank ypu - Lydie
Hi, Using Data Cache or not is a desgin choice, and you should clearly describe your consideration in design documnet. I choose to use it and the reason is to improve the reading performance. But it is not neccessary to do so. Find has nothing to do with this consideration. To implement find method, you may need some other assistant method, such as getAllRecords(), getNumberOfRecords(). If you use data cache, it will be very easy to implement those methods. What is important for the finding method is weather you clearly consider all scenario and code reuse. Weather you use data cache or not is ok.
I play Java for fun.<br /> <br />SCJP / SCJD / SCWCD / SCBCD