• 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

Please review my design decisions

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)?
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
All that thinking. Doesn't it hurt? What do you think about this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic