• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Use of java.nio

 
Olivier Gregoire
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,


I read all around the Internet that I may not use the java.nio package for SCJD. I don't have that kind of restriction in my instructions.html file. The only restriction I have is the following sentence: "You must use either serialized objects over a simple socket connection, or RMI." I chose RMI, but for some reason regarding the database file, I need the class Charset (which is in a subpackage of java.nio). So what is correct, what should I do?


Thanks and regards,
Olivier
 
Roel De Nijs
Sheriff
Posts: 9790
101
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Olivier,

From Sun's official scjd page:
The following APIs and facilities may not be used:
* Enterprise JavaBeans
* Servlets, JSP technology, or any other web-oriented APIs
* NIO, the New IO facilities
* Java DataBase Connectivity (JDBC) and SQL
* Java IDL API and CORBA
* Third party software libraries or tools (such as browsers)

So I think that's clear you shouldn't use it. I just used a RandomAccessFile in combination with the String constructor taking byte[] and charsetName, so I could finish my assignment without using nio-package.

Kind regards,
Roel
 
Olivier Gregoire
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Roel, and thanks.


I know all these constructors with charsets given as string in String, InputStreamReader, etc. but it seems so much more proper defining once and for all the charset and using it afterwards.

I'll mention a strong notice, telling that I would have worked with Charset if it wasn't giving me a kind of sword of Damocles :
- there is an explicit mention of using either java.io or RMI for client/server communication (and only in this scope) in the instructions.html
- there is an implicit mention of no jdbc (by defining the format of the database), EJB or servlets (because it's a J2SE certification)
- there is no mention of no java.nio at all in the document. The only time the string "nio" is present is in the word "junior" (or "senior", I don't remember).


Regards,

Olivier
 
Roel De Nijs
Sheriff
Posts: 9790
101
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Olivier,

I think everybody should have made other decisions when instructions were different or less restrictive. But you mention in choices.txt what you would have done differently and you'll be fine. I wanted to use the Data class as a kind of abstract dao class. And then you would have a RoomData (extending the Data class), and so you could easily create a CustomerData in the future for example. But I couldn't do that, so I just mentioned that approach in my decisions document.

Kind regards,
Roel
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy, Olivier!


- there is no mention of no java.nio at all in the document. The only time the string "nio" is present is in the word "junior" (or "senior", I don't remember).


It's "junior". And indeed, there is no mention of no NIO in the document. But as my good buddy Roel already pointed out, this is restriction is only listed in the page of the certification. The page he indicated is in the same style back when we took this certification, here's the new one.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic