Your server must be capable of handling multiple concurrent requests, and as part of this capability, must provide locking functionality as specified in the interface above.
Does this mean that I have to implement and use the locking code in Data class and not have a different one in the DataAdapter class ? I am having an DataAdapter basically calling the functions in Data except for lock/unlock.
Also, Can I use the factory pattern to dole out different instances of data/adapter to the client, given the above specs?
I am not really conversant with these. Appreciate help...
posted 13 years ago
I think my post was not clear.
My general design is like this: Data implements DBMain, DBAdapter implements DBClient which has the same methods as DBMain plus some extra methods which I want to expose. Only thing is lock/unlock methods have to be defined differently to send an instance of the adapter to the lock/unlock methods of the LockManager. In LockManager, I am using a HashMap<recNo, DBAdapter>.
It all appears to work fine..But I am not sure whether I am following the assignment's musts correctly.
Somewhere in the forum I read that factory pattern is not OK. The Sun's test may expect one Data instance with multiple concurrent clients.
Please let me know the holes in my design.
Thanks for your help...
Don't destroy the earth! That's where I keep all my stuff! Including this tiny ad: