• 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

Client/Server Design

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just started the assignment and have been thinking about the overall architecture design and have some concerns. The requirements says:
"if two clients attempt to perform the sequence lock, read, modify, write, unlock concurrently, then both modification attempts will be handled correctly."
"To connect with your server, you should create a client program. This implementation should include a class that implements the same public methods as the suncertify.db.Data class, although it will need different constructors to allow it to support the network configuration. "
I understand the "lock, read, modify, write, unlock" sequence to ensure data integrity. But I think this should be done on the server side instead of the client side. The server should publish a business method like "bookFlight" and hide the lock(), unlock(), modify()... from the client. This approach could avoid the "orphan" locks problem by the client-side locking approach due to potential network glitch.
My concern is whether I will be penalized for not following Sun's instructions? Has anyone passed with this approach?
Thank.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, because it is the basic approach that everyone takes. The use of a Facade class to hide the Data implementation from the client is the way to go. And it completely follows the requirements that are stated.
Mark
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Whoa, Mark, are you talking about the same thing that Tony proposed?

Originally posted by tony wang:
I understand the "lock, read, modify, write, unlock" sequence to ensure data integrity. But I think this should be done on the server side instead of the client side. The server should publish a business method like "bookFlight" and hide the lock(), unlock(), modify()... from the client. This approach could avoid the "orphan" locks problem by the client-side locking approach due to potential network glitch.

My emphasis.
Tony, I would expect you to be penalized for this. You would be working around some problems that Sun wants you to work through. It goes completely against the requirement to have a client-side class that implements the Data interface. You'd also reduce the reusability of your server to, erm, well, zero.
- Peter
[ February 20, 2003: Message edited by: Peter den Haan ]
 
Mark Spritzler
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No I didn't comment about him trying to do it on the server side, since in local mode there is no server to do it for him.
Mark
 
Tongyu Wang
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I see your point. Thanks.
 
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wait a second Tony -
I think there is some confusion here. When I read your message I hear you saying that you are going to present the client with a remote object that has a high level business method like bookFlight.
If this is right, I would advise against it. Here is a recent thread discussing this and it also has a link to an even better thread.
Data methods exposed to client discussion
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic