This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

posting again...pl help

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
    Bookmark Topic Watch Topic
  • New Topic