Hi, I am a new member and I am also new to Java. I started by reading Max's book, which I feel is an excellent starting point for people like me. I felt confident enough to start the assignment(Bodgitt and Scarper) after reading the book and I am planning to start with the data interface. I have the following questions about the initial design and would appreciate it some one can comment on them. 1. Is it required to create a separate class for handling the meta data? The requirements do not sepcifcally ask for it and I am thinking that it will be an overkill for this assignment. The drawback of not implementing the metadata class would be that I will be hardcoding the fields and their lengths. Will this matter? 2. I was also debating the idea of building a cache of the records in the memory. My idea is to implement a separate class that holds a list of records. However this means that in case of modifications to the database, I will have to update both the cache and the database file. Since I am a beginner, I am not able to visualize the pitfalls of this approach. Please somment. thanks, Raj
Welcome Raj, One thing you can always do is to search for previous threads in the forum on a particular subject, like metadata. To do this, use the link near the top of the page. The problem is, you may have to sort through a lot of threads that only just mention the subject. Regarding metadata, there have been a wide range of approaches that have been used successfully, including no metadata, i.e. everything hardcoded. I chose to go part way in this regard for the following reasons: 1. There is only 1 type of persisted data so I felt a full blown versatile metadata solution was not necessary and would add unneeded complextiy. 2. I went part of the way by using a metadata helper class to assist in performing field validation and binding for the file when reading it. I felt that this would increase the value of my solution to the customer (B & S) as it could then be more easily refactored into a more full blown metadata solution to support other data types and the potential future web application mentioned in my instructions. It was also not much more difficult than just burying the behavior somewhere in the code. Regarding a cache of records, again various approaches have been successful. The main disadvantage, I wouldn't call it a pitfall really, is a little added complexity and as you say having to pudate in both places, but IMO it has enough compensating advantages to justify it. I don't think you need an extra class for this. Hope that helps. Good luck on your assignment and enjoy the journey.
kktec<br />SCJP, SCWCD, SCJD<br />"What we observe is not nature itself, but nature exposed to our method of questioning." - Werner Heisenberg
posted 15 years ago
I didn't do it. You can't prove it. Nobody saw me. The sheep are lying! This tiny ad is my witness!
create, convert, edit or print DOC and DOCX in Java