• 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

Write lock

 
Ranch Hand
Posts: 688
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According to the requirement, the locking and unlocking is a write lock. Should I implement the "lock, read, update, write, unlock" in my server code or client code?
 
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Adrian,
My requirements mentioned a client program that exposed all the public methods of the Data class, i.e. lock, unlock, modify, etc. I took this to mean that the server should provide a thread-safe and remote means to access those methods in Data, and that the client interface should use them to query and manipulate the server. In other words, I'd put the lock-read-modify-unlock sequence on the client.
Jerry
 
Adrian Yan
Ranch Hand
Posts: 688
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's what I though too. Even thought the clients are exposed to all the public methods, it should be the client who respondible to ensure the locking. It also allow for future development.
 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you say client, you mean Data client and not the GUI, right? I would not want to perform the transaction sequence in the GUI code at all. Even if you use MVC pattern, it shouldn't exist within the controller, imo.
Sam
 
Adrian Yan
Ranch Hand
Posts: 688
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Of course, my client design is as follow:
1. a data client that has all the public method of the data.class, with additional methods to support the client booking, etc.
2. a simple GUI shell that will sit on top of the client, it calls the methods in the data client.
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it safe to say then that controller sets the state of the model and then model is essentially the DataClient with all its accessor method and also information about the current state of the view.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic