Originally posted by Jason Moors:
Hi everyone,
I don't want to annoy anyone by going over old ground, but I'm just trying to get back into the exam after a 6 month break, and have noticed a number of threads regarding the use of the 1.4 JDK with the 1.2 exam.
It seems from the threads that it's o.k to use the new features such as regex, NIO etc.
I currently have implemented my design without these features, and am concerned that I will be marked down for reinventing mechanisms provided by the 1.4 JDK.
Anyone got an opinion?
Thanks
Jason.
Hi Jason, glad to see you�re getting to the
SCJD. Good luck with it. Now, to answer your questions.
Logging, Exception chaining, regex, assertions, etc., the Thread.holdsock() method, the new
String methods, etc., are all solids reasons to use 1.4.
Quite frankly, I like the new tools a lot, and using them for a semi complex, but non-critical, application like the SCJD is a good way to really learn them.
However, I do have a few thoughts, specifically about the NIO features, because they pose an interesting question. I actively discourage it for the sake of networking code, because it doesn�t fit into the paradigm of �simplest to understand�, per the stated requirements.
But.
Using FileChannels deserves some careful consideration. On the one hand, rewriting the code to use FileChannels is a more robust approach, because FileChannels actually interact correctly with Threads that are blocked on IO(which the pre 1.3 jdks do not), and FileChannels are(IMO), cleaner to use.
OTOH, the code already provided for (this) version of the SCJD already has working File IO, and it's generally not a good idea to 'fix' something that isn't too broken.
So what should you do? Whatever you think is right. What did I do? I reluctantly didn't use FileChannels. However, if I had to write the IO code from scratch, FileChannels would have been my choice, hands down.
I guess my opinion is that you'll be better of using the 1.4 features, but I would stay away from NIO for this version of the exam.
Also, if you�d like to read further on this topic, please try
here.
Best regards,
M, author
The Sun Certified Java Developer Exam with J2SE 1.4 [ January 25, 2003: Message edited by: Max Habibi ]