• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

standalone vs. net client clarification

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
     
    Ranch Hand
    Posts: 243
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    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.
     
    Oliver Weikopf
    Ranch Hand
    Posts: 58
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

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

    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.
     
    Ranch Hand
    Posts: 1847
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    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).
     
    Ranch Hand
    Posts: 329
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    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
     
    Thirumurugan Mylrajan
    Ranch Hand
    Posts: 64
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thanks everyone, I think I missed a whole point in the requirements. I took corrective action.

    Trying to help someone is like Helping yourself..
     
    We begin by testing your absorbancy by exposing you to this tiny ad:
    We need your help - Coderanch server fundraiser
    https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
    reply
      Bookmark Topic Watch Topic
    • New Topic