File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Please review my design decisions

 
Kevin Mc Cusker
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
My design is pretty simple, but could you have a read through this and let me know your opinions on 2 points in particular?

Point 1.
OK, my Data.java has a few methods like for example, update, which requires a lockCookie as a parameter. Because of this I think i am forced to perform locking in both local and remote mode, which i am doing.

I dont want my GUI to call locks directly on my records so I have two other classes, localDBImp and RemoteDBImp which each hold a reference to my Data.java object. It is these classes only that call the locking methods of Data.java. Incidentally, these two classes can only perform search, read and update(for booking record).

Point 2.
I am using RMI. the remote object is RemoteDBImp which has a reference to Data.java, as i mentioned earlier. Here is where i am a little confused though.

In RemoteDBImp's constructor it calls:
private Data db = new Data();

My data.java has a few static lists for lockedrecords etc.

Say I have multiple remote clients. Are they all referencing the one UnicastRemoteObject RemoteDBImp and therefore the one Data.java object or should I somehow be creating a new Data.java object per client (therefore justifying my static lists)?
 
Thirumurugan Mylrajan
Ranch Hand
Posts: 64
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Kevin Mc Cusker:

Point 1.


Sorry, but what are you trying to ask?.


Point 2.
I am using RMI. the remote object is RemoteDBImp which has a reference to Data.java, as i mentioned earlier. Here is where i am a little confused though.


ok.. I dont know if you have considered multithreading issues when using RMI. RMI does not guarantee how the theads will be created and used. It has significant impact on the design. After considering that you can come to conclusion whether you want to use single data class or multiple data classes.

PS: There has been a good discussion about this within a few months. Please search for the same.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic