aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes standalone vs. net client clarification Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "standalone vs. net client clarification" Watch "standalone vs. net client clarification" New topic
Author

standalone vs. net client clarification

Eva Van Shtock
Greenhorn

Joined: Jun 02, 2006
Posts: 28
I just reread my instructions and I'm a little confused.

Network Approaches
Your choice of RMI or serialized objects will not affect your grade, but no other approach is acceptable. In either case, the program must allow the user to specify the location of the database, and it must also accept an indication that a local database is to be used, in which case, the networking must be bypassed entirely. No authentication is required for database access.


Does this mean that a user starts the app in network mode, but when it to comes
to entering the database location he can either indicate a local copy or network copy?

I finished implementing the assignment by making the decision using the
command argument. It says **must** above and I'm worried.

Any thoughts on this?
Edwin Dalorzo
Ranch Hand

Joined: Dec 31, 2004
Posts: 961
I see it this way:

The server side application needs to know where to search for the database file. This is something you have probably configured in your suncertify.properties file. However, you must also provide UI ways to change the location of this file.

Assume that the database file could be anywhere, not necesarily in the application directory. Then, you must provide a way to tell your server side app where to find the database file. It would be a screen that alters the current value in the suncertify.propertis file or it could be a start-up screen for your server side app where you ask the user the location of the database file before the server starts running.

On the other hand, the client application may connect with your server side application using remote methods. Even if the server and client are running on the same machine, you would still be using network loopback through remote methods to interact with the server side app.

In a case like this, it is probable that you provide a connection screen at the begining of the application execution in order to let the user specify the host and port where the server app is running. In this case you do not specify the location of the database file because that is responsability of the server side app.

However, the Sun specification states that you must be able to run the application in a standalone mode. This indicates that you will not use any kind of remoting to manipulate the database. Your server and client app run together in the same JVM. Hence you client app will directly create the database objects and ask their services.

In this case, during the application start up, you may provide the user with a way to specify the location of the database file in order to start the application in standalone mode.
Thirumurugan Mylrajan
Ranch Hand

Joined: Jan 26, 2006
Posts: 64
If you read the requirements completely it also says

"The mode flag must be either "server", indicating the server program must run, "alone", indicating standalone mode, or left out entirely, in which case the network client and gui must run."

So use command line parm to choose server or client and when the client opens you should be able to choose connecting to a local database or a network server.


SCJP , SCJD. (IBM 142 in progress).
Oliver Weikopf
Ranch Hand

Joined: Feb 17, 2004
Posts: 58
Originally posted by Thirumurugan Mylrajan:
So use command line parm to choose server or client and when the client opens you should be able to choose connecting to a local database or a network server.


Thirumurugan,

I disagree. There are three moodes.
  • Server - opens local database and provides it for clients. Started with "server"
  • Client - connects to a server, not to a local database. Started without params
  • Standalone - opens local database. No network connection. Started with "alone" param


  • So once you start the spplication, the mode defines what you can open. No further decision inside the application. If the client version allowed you to open a local database, there would be no point in having a standalone version.
    Jared Cope
    Ranch Hand

    Joined: Aug 18, 2004
    Posts: 243
    Hi,

    Originally posted by Oliver Weikopf:

    If the client version allowed you to open a local database, there would be no point in having a standalone version.


    My spec is pretty much the same as in the previous postings, but I believe that in client mode you must still be able to select a local database, in which case the application will 'switch' to 'alone' mode (even though it was started without the 'alone' command line parameter).

    Yes I agree this goes against the point of having a standalone mode but it is prefaced as a 'must' requirement and so that is what I am doing.

    As usual, I guess you just need to defend your decisions in your choices.txt file.

    Cheers, Jared.


    SCJP 1.4 91%, SCJP 1.5 88%, SCJD B&S
    Oliver Weikopf
    Ranch Hand

    Joined: Feb 17, 2004
    Posts: 58
    Originally posted by Jared Cope:
    I believe that in client mode you must still be able to select a local database, in which case the application will 'switch' to 'alone' mode (even though it was started without the 'alone' command line parameter).


    Jared,

    It doesn't say so anywhere. All it says is "the program" must allow this, not that client mode must. I allow the user to specify the local database file in either mode, but don't switch modes when he/she does.
    Furthermore, "the program must accept an indication that a local database is to be used" sounds like the "alone" parameter to me.

    But, as you said, either approach might be acceptable, and the specs aren't particularly clear, so it's something to note in the choices.txt and move on.
    Jared Cope
    Ranch Hand

    Joined: Aug 18, 2004
    Posts: 243
    Originally posted by Oliver Weikopf:

    "the program must accept an indication that a local database is to be used" sounds like the "alone" parameter to me.


    Ah right. So if I understand you, you interpret this indication to come from the command line at program start up. However I interpret it to mean at any point during application execution (specifically via a 'local databases' tab on my connection dialog window which is available at any time).

    Definitely deserves a sentence or two in the choices document I think.

    Cheers, Jared.
    Jeroen T Wenting
    Ranch Hand

    Joined: Apr 21, 2006
    Posts: 1847
    Originally posted by Oliver Weikopf:


    Thirumurugan,

    I disagree. There are three moodes.
  • Server - opens local database and provides it for clients. Started with "server"
  • Client - connects to a server, not to a local database. Started without params
  • Standalone - opens local database. No network connection. Started with "alone" param


  • So once you start the spplication, the mode defines what you can open. No further decision inside the application. If the client version allowed you to open a local database, there would be no point in having a standalone version.


    That's one way of looking at it. In my implementation though I've a dialog box to handle all connection details which has a switch from networked to local.
    All the commandline option does it determine which of the modes is presented as the default one.

    The server in my implementation is a different application altogether.

    Then there's a third application which is just a stub to launch either one of the other and pass it any command line parameters given (and is set as the main-class in the meta-inf).


    42
    Ken Boyd
    Ranch Hand

    Joined: Dec 10, 2003
    Posts: 329
    from my exam spec

    The mode flag must be either "server", indicating the server program must run, "alone", indicating standalone mode, or left out entirely, in which case the network client and gui must run.




    alone - standalone
    client - ask for server and port number (don't have to ask which connection network or local because spec says network client)
    server - means server


    SCJP, SCWCD, SCBCD, SCJD, BB Java2 and JSP1.1
    Thirumurugan Mylrajan
    Ranch Hand

    Joined: Jan 26, 2006
    Posts: 64
    Thanks everyone, I think I missed a whole point in the requirements. I took corrective action.

    Trying to help someone is like Helping yourself..
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: standalone vs. net client clarification