Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

B & S Locking question

 
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
 
Don't destroy the earth! That's where I keep all my stuff! Including this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic