Hi all,
I have the Bodgitt & Scarper v2.1.1 assignment.
So far, I have written my app using a DBAdapter class to wrap the business logic (including the lock/unlock calls) before calling the underlying methods in the Data class. For example, a book(...) call from client goes to a book(...) method in DBAdapter which calls the lock/update/unlock methods in the underlying Data class.
However, I've come across a problem. In my DB interface, the update(...) and delete(...) methods are defined as throwing SecurityException. So my data access implementation class, Data, must implement these methods, each throwing a SecurityException if the record is locked with a cookie other than lockCookie. This implies that locking/unlocking should be carried out in the Data class, rather than abstracted out into a business layer?
Also, the fact that update/delete methods in Data take a lock cookie as a parameter suggest that locking/unlocking should be done in the Data class.
Am I missing something here...
Thanks
A.
[ August 19, 2005: Message edited by:
Alan Mac ]