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

Use Case for Network Mode Start-up

 
Ranch Hand
Posts: 176
Netbeans IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey guys,

I am currently documenting the use cases for the newtork mode of operation.

I am thinking that the operation will roughly go like this:

1.Obtain the server details from the .properties file and/or the user.
2.Start the server if it is not already running.
3.Start the client and connect the client to the server.

Is this a good idea or should starting the application in netwrok mode be a two step process for the user?

ie
1. Start the server
2. Start the client which connects to the server

?

Thanks
 
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
When the user starts the network client, the network server should already be up and running (executed by a system administrator for example).
 
Glen Iris
Ranch Hand
Posts: 176
Netbeans IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you once again Roel.
 
Ranch Hand
Posts: 451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We also need the non-network mode, which is called alone mode based on Monkhouse book. I have a question: Do we need to implement multiple clients application without the RMI server in the alone mode?
When I ran Monkhouse 's Denny Dvd in alone mode, there is only 1 client running. In the exam, do we need to create multiple threaded clients updating the same db file when running on alone mode?
 
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
That's clearly stated in your instructions! Read them carefully.
 
Helen Ma
Ranch Hand
Posts: 451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let me go home to double check about non-network mode specification. I think my specification may be different from Glen's. Denny's DVD alone mode only deals with one client while the netowrk mode deals with multiple clients.
 
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

Helen Ma wrote:Let me go home to double check about non-network mode specification.


The main parts of the instructions are always the same. Luckily for us, makes moderating a whole lot easier The only things that differ (in the different assignments) are the name of the company you are working for, the interface you have to implement and the database file structure.
 
Helen Ma
Ranch Hand
Posts: 451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am revisiting the instruction about Non-network mode:


In this mode, the database and GUI must run in the same VM and must perform no networking, must not use loopback networking and must not involve the serialization of any objects when communicating between GUI and database element.

..... this mode must use the database and GUI from the networked form, but must not use the network server code at all.



It does not mention anything about creating multiple threaded clients (multiple GUI's) , reading/writing the db file concurrently.
I assume we can use Monkhouse' approach: start the GUI, read the db file and perform the rent/return/search. In the same VM, I don't see there are any multiple clients involved.
 
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
When i read the instructions carefully I notice this sentence:

instructions.html wrote:You may assume that at any moment, at most one program is accessing the database file; therefore your locking system only needs to be concerned with multiple concurrent clients of your server.



Helen Ma wrote:It does not mention anything about creating multiple threaded clients (multiple GUI's) , reading/writing the db file concurrently.


So that means you have different instructions (if you didn't encounter that sentence) or you are not able to read instructions carefully and understand them.

 
Helen Ma
Ranch Hand
Posts: 451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Roel De Nijs wrote:When i read the instructions carefully I notice this sentence:

instructions.html wrote:You may assume that at any moment, at most one program is accessing the database file; therefore your locking system only needs to be concerned with multiple concurrent clients of your server.



Helen Ma wrote:It does not mention anything about creating multiple threaded clients (multiple GUI's) , reading/writing the db file concurrently.


So that means you have different instructions (if you didn't encounter that sentence) or you are not able to read instructions carefully and understand them.



The sentence: "You may assume that at any moment, at most one program is accessing the database file....multiple concurrent clients of your server."
It is refering to the RMI network mode.

But for the standalone mode, there is no client/server relationship involved. In standalone mode, like Monkhouse's DVD example, there is only one client GUI, reading / writing the DB file.
I am sure it is very obvious that when in network mode (RMI/Socket), multiple clients and a single server relationships should be implemented.
When I read the non-network mode , there is no server involved. To my understand from the instruction and Monkhouse's DVD, I just need one client for non-network mode.
 
Glen Iris
Ranch Hand
Posts: 176
Netbeans IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Helen,

My understanding of this sentence:

You may assume that at any moment, at most one program is accessing the database file; therefore your locking system only needs to be concerned with multiple concurrent clients of your server.



Is that no other application, ie, an application separate to the one you are developing, will be accessing the database file.


G
 
Helen Ma
Ranch Hand
Posts: 451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Glen.
The sentence: "You may assume that at any moment..... multiple concurrent clients of your server...."
To my understanding is that you start a server (RMI/socket server), then you start multiple clients connecting to the server.

In the exam, besides RMI client/server application, there is also a standalone mode.
In the standalone mode, there is no server involved.
Monkhouse's book or Roberto's publication talks about network mode and non-network mode. These two modes are required.
It is understandable that network mode is the RMI / socket server responding to multiple client requests.

But for standalone mode, it seems to my understanding that we just need to start the application in one JVM, reading/writing the db file. It does not seem like we need to start multiple threads doing reading/writing the db file concurently in standalone mode. This is my question : Do we need to create multiple threads to read/write the db file in standalone mode?
(The assignment specification does not say anything about this even though Roberto's Data test create 10 threads doing updating in one class.)
 
Glen Iris
Ranch Hand
Posts: 176
Netbeans IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Helen,

I will be coding my application to deal with multiple clients running on one JVM accessing one local db file.

G
 
Helen Ma
Ranch Hand
Posts: 451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Glen.
Please verify what I wrote in the previous post.

In network mode, it is required that we need multiple clients and a single server doing conncurrent and thread safe reading/writing.
But in non-network mode, it does not say it is required that we need multiple clients reading / writing the same db.
If it is not requried in non-network standalone mode, I will use Monkhouse's approach : run one client doing one reading/writing.
 
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

instructions.html wrote:You may assume that at any moment, at most one program is accessing the database file;


That's clearly stating that at most one application will be accessing the database file. So if you are running the application in standalone mode, you know that for the whole time this application is running, this application is the only one accessing the database file (no network server, no other applications inside the company,...). No discussion there, instructions are very clear.

 
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

Helen Ma wrote:Do we need to create multiple threads to read/write the db file in standalone mode?


No.
 
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

Glen Iris wrote:I will be coding my application to deal with multiple clients running on one JVM accessing one local db file.


Huh How are you planning to start multiple clients in 1 JVM?
 
Glen Iris
Ranch Hand
Posts: 176
Netbeans IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey Roel,

by that I meant that concurrent instances of my application can be run at the same time by entering the command

java -jar <path_and_filename> <local_mode>

in many different command line windows on one machine.

do you see a problem with this?
 
Helen Ma
Ranch Hand
Posts: 451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Roel De Nijs wrote:

Helen Ma wrote:Do we need to create multiple threads to read/write the db file in standalone mode?


No.



Hi, Roel. Thanks for this reply. I can do the work in a similar way as Monkhouse's approach for the standalone mode, just one client's GUI, doing reading/writing, no other threadings doing concurrent reading/writing.

So, Roberto's Data test involves threads doing concurrently updating/findings... I am sure this test is simulating RMI multiple client requests.
 
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

Glen Iris wrote:do you see a problem with this?


No, certainly not (I did exactly the same). But then you have multiple clients running on same computer, not in same JVM.
 
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

Helen Ma wrote:So, Roberto's Data test involves threads doing concurrently updating/findings...


The purpose Roberto's Data Class test is simply to check if your Data class is thread-safe. So you'll get an answer on the question "can my Data class handle multiple concurrent requests from different threads without corrupting the data or hanging forever".
 
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

Roel De Nijs wrote:The purpose Roberto's Data Class test is simply to check if your Data class is thread-safe. So you'll get an answer on the question "can my Data class handle multiple concurrent requests from different threads without corrupting the data or hanging forever".


 
If you're gonna buy things, buy this thing and I get a fat kickback:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic