Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Client/Server Design

 
Tongyu Wang
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • 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
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • 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
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
I see your point. Thanks.
 
BJ Grau
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic