wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes scjd questions 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 "scjd questions" Watch "scjd questions" New topic
Author

scjd questions

Hieu Lam
Greenhorn

Joined: Jan 10, 2011
Posts: 10

Hi everyone,

I'm new here and I am looking for some advices from experience users who have done the scjd exams before, my very first questions are

1. In the GUI requirement, the assignment just require the ability to search for contractor and book the contractor, they don't mention about create/read/update/delete contractor, so do I have to provide that functionality. I see the signatures in the DBAccess interface
2. The provided data file contains a schema section which describe about the contractor fields but in the assignment also contains a section with similar information, so my question is do I have to read the schema sections and store it somewhere for further reference or I can hardcode the field metadata ?

Thank you so much for help me. This forums is really a good place for greenhorn like me !
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5218
    
  12

Hi Hieu,

Welcome to the JavaRanch and good luck with the assignment!

These are easy questions which you could certainly find the answer on using the search engine on this forum, because these questions are already asked many times.

Short answers:
1/ in the GUI only search and book will do, your Data class must have implementations for all methods (you could test the non-referenced methods using JUnit or TestNG)
2/ that's completely up to you: I read the schema section, my good friend and SCJD guru Roberto Perillo hardcoded the field metadata and we both passed. Just don't forget to justify your choice (in choices.txt that is)

Hope it helps!
Kind regards,
Roel


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2265
    
    3

Howdy Hieu!

Well champ, if you want to have an idea of how you can read dynamically the database schema, please take a look at the Database File Reader tool, so you can have an idea of how to do it.

Roel De Nijs wrote:I read the schema section, my good friend and SCJD guru Roberto Perillo hardcoded the field metadata and we both passed.


Well, you are still the one who got 400/400, champion!


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5218
    
  12

Roberto Perillo wrote:Well, you are still the one who got 400/400, champion!

Can't argue about that one But maybe a whole lot of ranchers passed with a maximum score, but they (and we) don't know anymore. Really unfortunate, just a pass/fail score is very little in comparison with the effort you have to put into developing your assignment (and then I don't even mention the money you have to pay)
Hieu Lam
Greenhorn

Joined: Jan 10, 2011
Posts: 10

Hi all,

I see this requirement in the spec "The GUI should be designed with the expectation of future functionality enhancements, and it should establish a framework that will support this with minimal disruption to the users". Which framework is being mentioned ? The code framework or a way of GUI design ?
I just have a simple gui that provide basic functionality, how can I address these requirement ?
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5218
    
  12

Just make sure that your gui can be easily extended with for example an Unbook-button. and that your gui does not need a complete redesign just because 1 button has to be added. In my main window I had the search criteria on top, in the center I had my table with the results and just below this table I had a kind of toolbar, containing all the buttons a user can click to perform an action on a selected record.
Hieu Lam
Greenhorn

Joined: Jan 10, 2011
Posts: 10

makes sense, Thanks.
Hieu Lam
Greenhorn

Joined: Jan 10, 2011
Posts: 10

Hi all,
I encouter another problem. I use thin client approach so I wrap my data access class by a service class and expose this service through RMI. So now, the service interface must throw RemoteException for all its public methods and the service impl class need to extends UniCastRemoteObject.

When in network mode, the client will get the handle to service by lookup,
In the standalone mode, I just use "new" to instantiate the service impl class

There is a rule that "The operating mode is selected using the single command line argument that is permitted. Architecturally, this mode must use the database and GUI from the networked form, but must not use the network server code at all."

Is my current code violate that rule because my standalone code use impl class which depends on RemoteException and UnicastRemoteObject ? I have try to create two separate interface, one for local, other for remote but I have problem with code reuse and .... so if my current code satisfy the requirement I just leave it as is.

Please comment on this
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5218
    
  12

I don't believe that's a violation and I believe people already passed with such an approach. I have a local and a network implementation of my business service, simply because it requires some other code.
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2265
    
    3

Hieu Lam wrote:Is my current code violate that rule because my standalone code use impl class which depends on RemoteException and UnicastRemoteObject ?


Actually, you shouldn't need UnicastRemoteObject in standalone mode. How exactly do you instantiate your business object in standalone mode? If you simply instantiate it without using UnicastRemoteObject to export it, then it's ok.
Hieu Lam
Greenhorn

Joined: Jan 10, 2011
Posts: 10

Roberto Perillo wrote:
Actually, you shouldn't need UnicastRemoteObject in standalone mode. How exactly do you instantiate your business object in standalone mode? If you simply instantiate it without using UnicastRemoteObject to export it, then it's ok.


To be more specific, this is part of my code :



I'm worried because in standalone mode, the code still depends on RemoteException, and UniCastRemoteObject. Although because no place in the implementation class throw RemoteException, it will never happens and some try/cacth block in the standalone mode will become redundant
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2265
    
    3

Howdy, Hieu.

Ok, I see. You know, you must declare RemoteException in the methods of your business interface, but you don't have to declare them in their concrete implementations (because the declaration in the interface indicates that the method may throw this exception, but it may not throw). Also, it is ok to handle the RemoteException in the code that consumes the business methods (an ActionListener, for instance). In fact, it is good because this promotes abstraction: the view must not know whether the application is being run in standalone mode or client mode. So, it is ok to say:

Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5218
    
  12

Hieu Lam wrote:the code still depends on RemoteException, and UniCastRemoteObject.

My remote business service implementation does not have a dependency on UniCastRemoteObject, like Roberto already indicated. You can use its exportObject method instead of extending.
Hieu Lam
Greenhorn

Joined: Jan 10, 2011
Posts: 10

Still one concern, to expose the remote service with RMI, I extends UnicastRemoteObject, however I see there's other way to achieve this. So which one is correct and is that the different between RMI versions ???


and currently I'm using Option1, do this violate the rule about using network server code ???
Hieu Lam
Greenhorn

Joined: Jan 10, 2011
Posts: 10

Roel De Nijs wrote:
My remote business service implementation does not have a dependency on UniCastRemoteObject, like Roberto already indicated. You can use its exportObject method instead of extending.


I didn't see your answer when I'm in the middle of typing the next question . Thanks Roel, I really don't like to expose the remote service by extending UniCastRemoteObject. There must be other way, like to create Thread, we have two option.
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2265
    
    3

Hieu Lam wrote:Still one concern, to expose the remote service with RMI, I extends UnicastRemoteObject, however I see there's other way to achieve this. So which one is correct and is that the different between RMI versions ???


Well, both are correct, but I personally prefer option number 2.
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5218
    
  12

Hieu Lam,
Your post was moved to a new topic.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: scjd questions