• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java rmi

 
subu ananthram
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just started with the networkign part and I have a couple of qns could someo ne please help me out here.
Regarding the rmi interface that extends Remote I have declared methods like bookARoom deleteABooking updateBooking e.t.c
The updateBooking may in turn make a call to lock() update() and unlock() on Data.java.
Is this ok?I dont like the idea of exposing to the client program (swing) methods like lock unlock etc
Any comments
Regards
Subu
 
Edwin Dalorzo
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my implementation I was reluctant to expose the Data class implementation, so actually, in my code Data class has package accessibility.

Over it I create a wrapper a class that implements a more elaborated interface. This wrapper implementation works with Java Collections to manipulate the database records, instead of using arrays. It also offers some concurrency features very useful to a database, for instance, it is capable of recognizing when a record has been updated in the database before letting the record be updated with old record data. It also provide a more elaborated search mechanism based on the same functionality provided by the underlying Data class.

In this wrapper class I have an update method, it is responsible for locking, updating and unlocking the database record using the services provided by the underlying Data class.

That's what I am doing, but of course, since I have not yet presented my assignment I cannot guarantee this is the best approach. Although it works pretty well for me and as far as I am concerned it is compliant with my assignment requirements.
 
josine wilms
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Subu,

I did it the same as you! I'm sure it's fine. At the end of building your application, do check well your design with locking and error handling within client/server architecture.

Good luck,
Josine
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic