• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hard coding server bind name, a big NO, how???....

 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,
i feel very very uncomfortable to make a lookup
by hardcoding the server name in the client. i know this the way how the RMI clients are coded , always......
currently the client provides the
1.port,
2.host name and
3.database file
is it not true, if the port and host name are given , then it should given me "whatever" is hanging there. ok, the reason may be more than one implementation can be hanging in the port, as it is virtual. i don't, don't like the idea of changing the client code just because the server is bound by a different name.
coming to the point,
would it be a better idea to bind the server using the name of the interface ot implements like ConnectionFactory so that i can plug-in any implementaion and my client is living happily ever after....


but i have seen the same issue, in all Client Server systems, say in Oracle client, even though the port and server or specified i need to give the instance name

please guide me with yout thoughts!
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

is it not true, if the port and host name are given , then it should given me "whatever" is hanging there. ok, the reason may be more than one implementation can be hanging in the port, as it is virtual. i don't, don't like the idea of changing the client code just because the server is bound by a different name.

I am not exactly sure what you are asking. The RMI lookup should look something like this on the client:

SERVICE_NAME in the code above is just a string, such as "Fly High". If you want to minimize the impact of the server binding the object to a different name in the registry, and avoid the collisions in the registry namespace, you could use the name of the interface of the object that is bound to the registry. For example:

Whatever the case, it is obvious that both server and client must use the same name to bind and lookup the object in the registry.
Eugene.
 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Eugene Kononov:

Eugene.

i am just talking about the provding the SERVICE_NAME for the lookup. what i thought is given the host and the port, it should give us whatever object is lying there at the given port and host without the need of a SERVICE_NAME. anyhow, came to know that, it's a necessary evil and can't be avoided, from your post.

If you want to minimize the impact of the server binding the object to a different name in the registry, and avoid the collisions in the registry namespace, you could use the name of the interface of the object that is bound to the registry.

yes, i am looking something like using the interface name to bind as the SERVICE_NAME.
Thanks Eugene for the examples. i am sort of woke of from my virtual realities of RMI after going thr' the examples.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic