• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

B & S Locking question

 
Vishnu Sri
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My assignment says:

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...
 
Vishnu Sri
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I think my post was not clear.

The lock/unlock methods do not allow use of cookies. So I went by database factory (which I am not sure is OK given my specs).

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...

V
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic