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.
SCJP, SCJD<br />"He who knows others is wise; He who knows himself is enlightened."<br />-- Lao-Tzu (6th century B.C.), Legendary Chinese philosopher
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
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 ]
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