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 Use new 1.4 features or not? 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 "Use new 1.4 features or not?" Watch "Use new 1.4 features or not?" New topic
Author

Use new 1.4 features or not?

Jason Moors
Ranch Hand

Joined: Dec 04, 2001
Posts: 188
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.
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
Well, you don't have a lot of scope to use either regex or nio anyway. You might want to use the logging framework if you have some logging.
- Peter
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

And you won't lose points if you do not use 1.4
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Max Habibi
town drunk
( and author)
Sheriff

Joined: Jun 27, 2002
Posts: 4118
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 ]

Java Regular Expressions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Use new 1.4 features or not?