• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

scjd questions

 
Greenhorn
Posts: 10
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 !
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 10
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 10
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
makes sense, Thanks.
 
Hieu Lam
Greenhorn
Posts: 10
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 10
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 2292
3
Eclipse IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 10
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 10
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 2292
3
Eclipse IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hieu Lam,
Your post was moved to a new topic.
reply
    Bookmark Topic Watch Topic
  • New Topic