File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes B&S, first thoughts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "B&S, first thoughts" Watch "B&S, first thoughts" New topic
Author

B&S, first thoughts

Thomas Henrichs
Greenhorn

Joined: Mar 21, 2007
Posts: 2
Hello and greetings!

I have (had) to begin the task of doing the SCJD and I am now in a (possibly normal) state of shock

I read the SCJD-book by Andrew Monkhouse and Terry Camerlengo and it soothed my initial shock and panic a huge bit, but I still have too many thoughts and ideas running around. I try to get my thoughts together to create a coherent plan and design, but I have some first ideas and questions, so I hope someone will give additional ideas.

Would it be a good idea to read in the whole DB-file (at creation of the DBaccess class) and fill in some Value Object and store those with the record number, or just store the record number together with the bytewise location in the file? I tend towards the latter...

Furthermore, I made the assumption that since the DB schema is explicitly given in my assignment, I use this information as the base for a Value Object (trading it for flexibility) and "only" use the schema definition in the file's header section for file validation purposes. Is this a "valid" assumption (I haven't read anything that means I should generate the schema dynamically...) Would an extra validation class and file-reading class be better design than to handle that whole stuff directly in the DBaccess-class?

And another stupid question... In my assignment, the schema says that the rate field includes a currency symbol. Now, should I treat that as a simple String, or split it into a value/currency pair? The first approach would be simpler but also means I wouldn't be able to differentiate between negavite/positive values or different currencies (maybe for future releases including creating/adding entries), the second one would be a bit more work.

Thanks for any help in advance...
Thomas
Lucy Hummel
Ranch Hand

Joined: Apr 07, 2005
Posts: 232
Hi Thomas,

Your title First Thoughts seems to be valid. If you use the search function of the forum you will already found opinions, suggestions, answers to your questions.

Br, Lucy


----------------------------------<br />| SCJP, SCWCD, SCBCD, SCEA, SCJD |<br />----------------------------------
Vincent Li
Greenhorn

Joined: Jan 12, 2007
Posts: 22
Hi Thomas,

Originally posted by Thomas Henrichs:

...
Would it be a good idea to read in the whole DB-file (at creation of the DBaccess class) and fill in some Value Object and store those with the record number, or just store the record number together with the bytewise location in the file? I tend towards the latter...


That's your decision. Whatever works for you. I used the former and read it in so I can do the search more quickly and easily.


Furthermore, I made the assumption that since the DB schema is explicitly given in my assignment, I use this information as the base for a Value Object (trading it for flexibility) and "only" use the schema definition in the file's header section for file validation purposes. Is this a "valid" assumption (I haven't read anything that means I should generate the schema dynamically...) Would an extra validation class and file-reading class be better design than to handle that whole stuff directly in the DBaccess-class?


Again, that's up to you. It's your design decision. For validation, it seems to be just good OO design to have something separate for validation and reading. I did the reading in a loadSchema() method in the Data (DBAccess) class, but no validation, assuming that can change.


And another stupid question... In my assignment, the schema says that the rate field includes a currency symbol. Now, should I treat that as a simple String, or split it into a value/currency pair? The first approach would be simpler but also means I wouldn't be able to differentiate between negavite/positive values or different currencies (maybe for future releases including creating/adding entries), the second one would be a bit more work.


There are no stupid questions. I would ask - do you need to manipulate that rate field in any way? If not, then a simple String would do. If you need to compare or filter it by its value, then you may need to parse it.

I had the same project and since the rate is not required for search or otherwise manipulated, it is left as a string.

Hope that helps.
[ March 22, 2007: Message edited by: Vincent Li ]

Vince<br />SCJP(1.4), SCWCD(1.4), SCJD (5.0)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: B&S, first thoughts