• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Should I make local/remote selection screen?

 
Youji Tanaka
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all.

I have a simple question that is bugging me.

From my instructions
The user interface should connect to the database using either a local or a network based connection according to user choice.


Does it mean that I must make user interface for selecting local or remote mode?
I'm preparing two classes that include main method.
one is for standalone client.
another is for network client.
I don't make user interface for selecting local or remote mode.

Is it right way?

Thanks for response


 
Darya Akbari
Ranch Hand
Posts: 1855
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Youji,

welcome to JavaRanch and this forum .

You only need one main, not two classes with a main in it. You also don't need to provide a seperate client main and server main.

The point is that you must use a flag in your commandline to start your server, client or standalone application.

So that you start your one application with either:
  • java -jar runme.jar server (server application) or
  • java -jar runme.jar (client application) or
  • java -jar runme.jar alone (standalone application)


  • You can decide at runtime what portion in your main method you start according to the command line parameter (mode flag).

    Check your assignment to be safe and search this forum for more info.

    Regards,
    Darya
    [ July 12, 2005: Message edited by: Darya Akbari ]
     
    Youji Tanaka
    Greenhorn
    Posts: 6
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks Darya

    However, My instructions(in Japanese says that

    You can use only follow parameters
    DNS name
    Port number
    Data file
    java.rmi.server.codebase
    policy file

    So, I can't use mode parameter.

    Thanks for response
     
    Darya Akbari
    Ranch Hand
    Posts: 1855
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi Youji,

    that's interesting, because all others seem (at least those who I've heard from in this forum) to follow the path I described .

    Youji, don't you have something in your assignment that you must start your server with java -jar <path_and_filename> [<mode>]?

    Regards,
    Darya
     
    Andrew Monkhouse
    author and jackaroo
    Marshal Commander
    Pie
    Posts: 12014
    220
    C++ Firefox Browser IntelliJ IDE Java Mac Oracle
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi Youji,

    It sounds like you are doing the Fly By Night Services assignment - did you receive this assignment some time ago?

    Creating an interface that allows the user to specify the connection mode is a simple way of handling this. In the book "The Sun Certified Java Developer Exam with J2SE 1.4", Max recommends using a dialog for this.

    In my project I had a front screen that allowed this information to be entered, but I also allowed users to enter information from the command line, which if entered, meant I could skip the connection screen (if someone puts a file name on the command line then chances are the file is local, whereas if they put an IP address chances are you are connecting to a server ).

    Regards, Andrew
     
    Youji Tanaka
    Greenhorn
    Posts: 6
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks Darya, Andrew

    From Andrew
    It sounds like you are doing the Fly By Night Services assignment - did you receive this assignment some time ago?


    Yes, I am doing FBNS assignment.

    I understood as follows.

    1. If users don't enter commandline, a front screen that allowed mode information to be entered appears.
    2. If users enter a file name on the command line, a front screen don't appear. Client application works as standalone mode.
    3. If users enter IP address on the command line, a front screen don't appear. Client application works as network mode. A port number is default value(1099).
    4. If users enter IP address and a file name on the command line, users are informed error.

    is it right?
     
    Andrew Monkhouse
    author and jackaroo
    Marshal Commander
    Pie
    Posts: 12014
    220
    C++ Firefox Browser IntelliJ IDE Java Mac Oracle
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi Youji,

    Sounds reasonable.

    For scenario 4, after displaying a dialog box telling them that they are in error (and why), I would then proceed to step 1: give them the option to enter connectivity details.

    Regards, Andrew
     
    Youji Tanaka
    Greenhorn
    Posts: 6
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks Andrew!
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic