aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Please review my design decisions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Please review my design decisions" Watch "Please review my design decisions" New topic
Author

Please review my design decisions

Kevin Mc Cusker
Greenhorn

Joined: Aug 06, 2003
Posts: 21
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

Joined: Jan 26, 2006
Posts: 64
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.


SCJP , SCJD. (IBM 142 in progress).
 
 
subject: Please review my design decisions