GeeCON Prague 2014*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Standalone mode: Is it necessary to sync data among different clients? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Standalone mode: Is it necessary to sync data among different clients?" Watch "Standalone mode: Is it necessary to sync data among different clients?" New topic
Author

Standalone mode: Is it necessary to sync data among different clients?

Rodrigo Uchoa
Greenhorn

Joined: Feb 12, 2008
Posts: 15
Hey guys!

Do we have to deal with data sync if multiple clients are using the program in standalone mode? To me, if this would be a real software, this "standalone mode" requirement would not make much sense. If we let different CSR's have their own local database, how can information be the same for all of them?

Am I missing something?
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2265
    
    3

Fala Rodrigo!

Champ, you can assume that, in standalone mode, only one CSR will be using the program at a given time. So, only one instance of the program will be running. However, the locking mechanism must still be used, even in standalone mode. So, when booking a room, the logic of the method must still lock the record, update it and unlock it.
Rodrigo Uchoa
Greenhorn

Joined: Feb 12, 2008
Posts: 15
Well, that's a relief Syncing that offline data would be a mess.

Thank you!
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5300
    
  13

Even in networked mode it is not necessary to push changes to all connected clients.


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Rodrigo Uchoa
Greenhorn

Joined: Feb 12, 2008
Posts: 15
Roel De Nijs wrote:Even in networked mode it is not necessary to push changes to all connected clients.


Roel,

Your post got me thinking... Never crossed my mind to push changes to clients in networked mode, since they're all connected to the "same synchronized data". Are there any hints in the instructions that this might be necessary?
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2265
    
    3

Rodrigo Uchoa wrote:Are there any hints in the instructions that this might be necessary?


It isn't required at all. There are hints saying that, if you do something that is not asked, you won't get any extra point for it
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5300
    
  13

Rodrigo Uchoa wrote:Are there any hints in the instructions that this might be necessary?

No, there are not, that's why I mentioned it was not necessary In this forum you can find a few topics were people ask if this one is necessary, so I just wanted to already answer a possible question.
Jim Hoglund
Ranch Hand

Joined: Jan 09, 2008
Posts: 525
In the real world, multiple clients would need to see current data. So
pushing data changes would be required. Even though the EarlyBird
requirements don't ask for it, I am doing the client updates through
RMI. I have also expanded quite a few other features.

I hope making the system more realistic doesn't earn demerits for
too much complexity. Has anyone heard about penalties for this?

Jim ...


BEE MBA PMP SCJP-6
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5300
    
  13

Jim Hoglund wrote:In the real world, multiple clients would need to see current data. So pushing data changes would be required.

I agree the multiple clients should see current data, but I don't agree that you should push the changes to all connected clients. We have a real world application with 100s of clients, but we are not pushing changes to all these clients. That's simply generating unnecessary network traffic. And users may be confused because the data on the screen changes while they have done nothing.

Jim Hoglund wrote:Has anyone heard about penalties for this?

There are 2 guarantees:
1/ for doing extra things you won't receive extra credit, but you might lose points because the extras are not bug-free
2/ if these extras make your solution too complex, you might lose points because a simple understandable solution by a junior developer is preferred. If you add some unneeded extras, don't forget to mention it in your choices.txt. I also added something which was not required, but I justified it in choices.txt, because in my opinion the extra code would make the program easier to extend and maintain (and as you can see I passed, even with a maximum score). So you can add extra functionality without losing points if it's applicable and correctly justified.
Jim Hoglund
Ranch Hand

Joined: Jan 09, 2008
Posts: 525
Thanks Roel,

I am afraid of over-doing it but I like a very user-friendly feel.
I intend that it be bug-free and intuitive in the code too, but I
may need to pull out some of the funkiest bits. I'm using some
1.6 stuff like SwingWorker and GroupLayout plus generics and
lots of boxing.

Jim ...
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5300
    
  13

Jim Hoglund wrote:I am afraid of over-doing it but I like a very user-friendly feel.

My GUI was just what was required, nothing more nothing less and I may say it was very user-friendly with a very restrictive look-and-feel. The code was also bug-free and intuitive: no SwingWorker, GroupLayout,... just good ol' plain Swing. So you can have a simple intuitive gui without overdoing it

Good luck!
 
GeeCON Prague 2014
 
subject: Standalone mode: Is it necessary to sync data among different clients?