• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Singleton Design Pattern in RMI

 
Rudy Yeung
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The RMI server requires the instantiation of a single remote object to be passed to the Naming.rebind() method. Can this be considered a singleton pattern design?
 
Paul Anilprem
Enthuware Software Support
Ranch Hand
Posts: 3819
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, you can always create more than one object of the (remote) class and bind them with different names. In singleton pattern, the class itself provides a mechnism to instantiate an (and only one) object. You don't (and can't) do a new for that class (as the constructor is private), instead you do ClassName.getInstance() to get an instance of that class.
-Paul. http://www.enthuware.com/jdevplus
Your guide to SCJD!

------------------
Get Certified, Guaranteed!
(Now Revised for the new Pattern)
www.enthuware.com/jqplus

Try out the world's only WebCompiler!
www.jdiscuss.com
 
Rudy Yeung
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul,
If that is the case, can I say that the RMI server acts as a singleton agent over the FBN database? There is supposed to be only one RMI server accessing to the database in the assignment.
Rudy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic