• 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

RMI Basic Concepts 01

 
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Let us assume that the software will not address multiple database
file tables (as it is assumed that appropriate changes could be made
to handle this case).
Let us assume that the client can connect either locally or remotely.
Let us assume that a ConnectionFactory object is defined whose
purpose is to return an interface type IndependentConnectionInterface.
The client invokes the ConnectionFactory telling it whether it wants
a local or a remote connection. The ConnectionFactory, if getting
a local "connection", returns the appropriate local object which
implements IndependentConnectionInterface. If getting a remote connection,
the ConnectionFactory looks for an RMI registry binded object, obtains
it, and returns it since this remote object also implements
IndependentConnectionInterface.
So, the client's code looks like this:

For the above design, two things need to be implemented
as remote objects:
the "connection" and the "myServer" for option 1 design
or
the "connection" and the "data" for option 2 design
depending on the design chosen.
The above, is essentially a question: that is, is what is stated
correct?
Thanks,
Javini Javono
 
Ranch Hand
Posts: 619
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Javini,

Originally posted by Javini Javono:
Hi,
Let us assume that the software will not address multiple database
file tables (as it is assumed that appropriate changes could be made
to handle this case).
Let us assume that the client can connect either locally or remotely.
Let us assume that a ConnectionFactory object is defined whose
purpose is to return an interface type IndependentConnectionInterface.
The client invokes the ConnectionFactory telling it whether it wants
a local or a remote connection. The ConnectionFactory, if getting
a local "connection", returns the appropriate local object which
implements IndependentConnectionInterface. If getting a remote connection,
the ConnectionFactory looks for an RMI registry binded object, obtains
it, and returns it since this remote object also implements
IndependentConnectionInterface.
So, the client's code looks like this:


I think I agree with what you've written to this point.


I think the conventional name for this method would be create rather than getInstance, but that's really a quibble about nomenclature for the factory design pattern.


Here's where you start to lose me. I've no idea what an IndependentServerInterface is so I'll just ignore option 1 for now.


I think I agree with what you've written so far (option 2, that is).


For the above design, two things need to be implemented
as remote objects:
the "connection" and the "myServer" for option 1 design
or
the "connection" and the "data" for option 2 design
depending on the design chosen.
The above, is essentially a question: that is, is what is stated
correct?


My comments only address option 2 (I'm ignoring option 1 for now because I don't understand it):
I see why "data" would have to be a remote object. I don't see why "connection" would have to be remote object. It seems to me that "connection" would be a local object and that getData is the method that does the Naming.lookup to get the remote object "data."
Hope this helps,
George
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Javini,


I am not sure about your usage here. Normally you would not need to have them implement Serialiazable, but you may have some usage for that.
Regards, Andrew
 
reply
    Bookmark Topic Watch Topic
  • New Topic