• 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

Two-way RMI communication required?

 
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, I have a question regarding to the exam.
Is two-way RMI communication required for the exam? Do I need to make the server send data back to the client?
When I ran Denny's DVD project, I observe this scenario:
1. Start server using RMI
2. Start client 1
3. Start client 2
4. Client 1 rent Army of Darkness. The number of copies is decreased from 7 to 6.
5. But Client 2 's window still shows 7 copies of Army of Darkness.

The reason is because the server does not send updated data back to Client 2.
So, in the real-exam, are we required to make client server talk in 2 ways?
If that is not required, I think I don't need to make the RMI application complicated.
 
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, Helen!

So, in the real-exam, are we required to make client server talk in 2 ways?



No. This is not required. I myself implemented the client's updating in a piggyback style. So, for instance, let's say that client 1 is looking at the window, and all records are available. Client 2 updates record 2 and client 3 updates record 3. Client's 1 window is not updated. Then, client 1 updates record 1. When he does so, then his window is updated, showing that records 1, 2 and 3 where udpated. So the client's window is only updated when he/she sends some data to the server.
 
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, Roberto.
To make sure I understand the exam requirement, this scenario :
1. Client 1 rents Army of Darkness, which has 7 copies originally. It locks the record, decrease the number of copies by 1 and unlocks it.
2. During the same time, Client 2 , Client 3, Client 4 all see 7 copies even after Client 1 rents one copy of Army of Darkness.
For the exam, the scenario is still fine.
(Even though in real-life applications, we hope client 2 , 3, 4 should see 6 copies of Army of Darkness after client 1 rents it.)

Thanks in advance.
 
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
Yes, that's fine.

When client 4 refreshes the view (by similar search for example), he/she 'll see the 6 remaining copies of the Army of Darkness dvd.

off-topic: I don't know if you want that behavior in a real-life application. Because that will cause a lot of network traffic to push all these updates. And why would a client be interested in how many copies there are left? When a rent is made the only thing that matters is if the item is available. If it is, it's rented; otherwise an exception is thrown.
 
reply
    Bookmark Topic Watch Topic
  • New Topic