In my application, I have one interface like "IndependentDataInterface" from client side to polymorphycally call DataAdapter's methods. I used a Decorater
pattern here to delegate calls inside the class "RemoteDataAdapterImpl" to the class "LocalDataAdapterImpl" (a kind of technique used in Java I/O hierrachy).
So bookRoom method
1). for class "LocalDataAdapterImpl' is simply like (no lock/unlock is invloved):
Data.update(...)
2). For "RemoteDataAdapterImpl" has to be different by adding lock/unlock functionalities like:
Data.lock(recNo)
Data.update(...) // or could delegate to "LocalDataAdapterImpl" update(..) method.
Data.unlock(recNo)
I agree with Andew, that from OO design viewpoint, lock/unlock must be used in "LocalDataAdapterImpl" for non-networked mode. On the other hand, from the assignment specification, lock/unlock should NOT be used for lock/unlock since only ONE client is assumed to use the system, as far as lock/unlock overhead is concerned for non-netowked mode.
Any brighter ideas here, please advise, ranchers! Thanks.
