• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

B&S network mode over sockets

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
has anybody used to implement the networking over sockets?
I use to send commands over a socket connection to the server.
Multiple clients should be notified if the data changed on the server, e.g. a contractor has been updated. Am I right?
But I don�t have any idea how to notify the clients.
Is there anybody who can help me or give me some hints?
thx for any help.
dewe
 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by daniel wolff:
...
Multiple clients should be notified if the data changed on the server, e.g. a contractor has been updated. Am I right?...



Hi dewe,
I don't believe it is required that clients are notified of updates to the data file (I'd appreciate some confirmation on this from anyone), but I believe I've read some posts in the forum of people who have implemented this feature. However, you should have some mechanism to prevent a client from overwriting another client's update to a record. My current implementation has a message dialog box telling the user that the contractor she is trying to hire has already been hired by another client (and then the table updates itself with that other client's ID number).
Regards,
Paul
[ November 08, 2003: Message edited by: Paul Tongyoo ]
 
daniel wolff
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Paul,
thats good news, because I have to hand in my work on the 17.Nov.
And I have no idea yet. But am I not right that the model is on the server side and has to notify all the views that are on the client side?
Thx for your hint, it will possibly save me from unnecessary work.
cya dewe
 
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Daniel,
I agree with everyhing Paul wrote above : you don't need the client notification mechanism you describe. Each time a client want to book a record, lock it and check that the record is still "bookable" before updating it :

Best,
Phil.
 
Paul Tongyoo
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by daniel wolff:
...
thats good news, because I have to hand in my work on the 17.Nov.
And I have no idea yet. But am I not right that the model is on the server side and has to notify all the views that are on the client side?
...


Hi dewe,
I believe Sun's specifications will force you to make some adjustments to the MVC pattern (for the better?) if you plan on applying it to your entire system. I haven't personally used MVC in this way (I'm using the pattern entirely within the context of my GUI layer); but I can see how it may make sense-- yes it makes sense that your server represents the Model and yes it makes sense that your client-side GUI can be one of many types of Views, however the part where MVC states that the Model is supposed to notify its Views of changes is not a requirement for this project so you'll probably do away with alot of unnecessary code (and time?) by leaving that function out.
With that being said, if you decide to not have your server (model) notify all clients (views) of changes, maybe you should think about applying the MVC in a different context? It's possible if you leave the function out and still document that your system is based on an MVC architecture, Sun may think you're misunderstanding the pattern, which is clearly not the case.

Good luck with your deadline! I tried to tell myself I'd turn this in last Friday, but small things kept coming up - hopefully this Friday will be the day.

Originally posted by Philippe
I agree with everyhing Paul wrote above


Phew! Thanks for the confirmation Philippe
Regards,
Paul
[ November 09, 2003: Message edited by: Paul Tongyoo ]
 
daniel wolff
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi *
I thank you guys ;o] I try to do my best an hope that monday will not be a bloody monday. No, I�m just kidding.
Maybe I can post my "best" results in the near future.
thx
dewe
 
We don't have time to be charming! Quick, read this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic