• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

posting again...pl help

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
friends,
I use factory pattern (RMI) to obtain a wrapper of Data class in remote mode. I bind ConnectionFactory to registry which implements ConnectionInterface. it's getConnection() returns RemoteDataAccess object. (RemoteDataAccess implements DataInterface which contains all public methods of Data.) I have implemented locking thru LockManager... my connection object has an instance of LockManager. RemoteDataAccess calls lock( recno) of LockManager.
Should my remote client have DataInterface, ConnectionInterface and LockManager classes stored in it?
excuse me. I am new to RMI.
 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Nagu,
Not being totally aware of you design, I can't make a complete judgement here but generally speaking, the less the client knows about the server or connection, the better.
You should use a Facade pattern to separate the the two subsystems on the client: GUI and database. Now your Facade class will obviously have to have a reference to your DataAccess implementation. Assuming that your RemoteDataAccess extends DataAccess you should still only access through the parent interface (DataAccess) if that is possible. Hopefully, you have designed your db package so that there is no need for the Facade to have a reference to the LockManager. You should just be able to call lock and unlock on your interface. I only had one interface for both remote and local. My client was oblivious to whether it was in local or remote mode. Locking in local mode was just a no-op.
Hope this helps,
Michael Morris
 
reply
    Bookmark Topic Watch Topic
  • New Topic