GeeCON Prague 2014*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Max, a question about your DVD Example Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Max, a question about your DVD Example" Watch "Max, a question about your DVD Example" New topic
Author

Max, a question about your DVD Example

Joy DeGrazzio
Greenhorn

Joined: Jul 26, 2003
Posts: 5
Hi Max, you're book has been very useful but I have a question concerning your implementation of RMI.
On page 126 you have a discussion point about multithreaded DVDDatabase objects vs. Single DVDDatabase objects. You say that "we choose to implement DVDDatabse in a manner consistent with figure 4-13. That is, several instances of the DVDDatabase object can exist."
Now here's my question: How can several DVDDatabase objects exist when you create only one instance in your RegDVDDatabase class and bind it to the RMIRegistry? Won't all remote clients share this instance?
So isn't your program more like figure 4-14? A Single DVDDatabase object being shared by multiple clients? Please tell me where I'm going wrong with this, because I'm sure I'm mucking something up somewhere.
Max Habibi
town drunk
( and author)
Sheriff

Joined: Jun 27, 2002
Posts: 4118
Hi Joy,
I can see where you might find the passage confusing. The point is that the sample code, as written, is robust enough that it could accommodate figure 4-13: the static vector takes on the role of the class-wide coordinating structure. However, we're not using it to it's fullest extent. It's only used in a manner consistent with figure 4-14. Basically, what we're saying is that we have a car that could go 200 mph, but we're only driving 65 mph.
M


Java Regular Expressions
 
GeeCON Prague 2014
 
subject: Max, a question about your DVD Example