• 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

please review the ConnectionFactory .....

 
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
could someone please review the ConnectionFactory code and let me know of any holes.

i am just considering that the ConnectionFacory will be reused for different database files.
your comments are very much welcome. please help!
[ January 27, 2003: Message edited by: aadhi agathi ]
 
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You've got the right idea, you code just needs some refactoring. You don't need to store server dns, port, and path to database in your "argument" hashmap: you can safely assume that there will be only one server running at any time. Consequently, all you need to keep in your map is the database name and its instance of data, along with its lockmanager. So the structure of your map may look like this:
[databasename --> (instance of Data, instance of lockmanager)]
That is, database name (without the path) is the key, and the pair (instance of Data, instance of lockmanager) is the value. My RemoteDataFactoryImpl class is very similar, but it's just 20 lines long. Talking about the class name, I would avoid "ConnectionFactoryTry": first, your class name should be a noun (or a combination of nouns/adjectives), and second, the postfix "try" in the class name may scare the users to instantiate/use the class
Eugene.
[ January 27, 2003: Message edited by: Eugene Kononov ]
 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Eugene Kononov:
Consequently, all you need to keep in your map is the database name and its instance of data, along with its lockmanager. So the structure of your map may look like this:
[databasename --> (instance of Data, instance of lockmanager)]
I would avoid "ConnectionFactoryTry": first, your class name should be a noun (or a combination of nouns/adjectives), and second, the postfix "try" in the class name may scare the users to instantiate/use the class
Eugene.
[ January 27, 2003: Message edited by: Eugene Kononov ]


first, thanks a zillion Eugene, for reviewing. Actually i have another version of ConnectionFactory as you have pointed out. But as i wanted to reuse the COnnectionFactory, so i have tried this version


But i haven't got the server bind in the registry , but the clients do have the stub of the server as sell as the ConnectionFactory. what is the siqnificance of binding the server .won't it suffice to have only the Factory bind in the registry


Kindly comment and help a RMI Amateur .
[ January 27, 2003: Message edited by: aadhi agathi ]
[ January 27, 2003: Message edited by: aadhi agathi ]
 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it works without the server being bound in the registry.
but will there be any significance of the server being bound to the registry. i feel it will be the other way round. ie., the client shouldn't bypass the ConnectionFactory.
comments please!
[ January 28, 2003: Message edited by: aadhi agathi ]
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


but will there be any significance of the server being bound to the registry. i feel it will be the other way round. ie., the client shouldn't bypass the ConnectionFactory.


There is no reason to bind anything to the registry if you already bind connection factory. The clients looks up the registry, gets the factory, invokes a method on that factory, and factory creates a remote object for the client.
Eugene.
 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Eugene Kononov:

The clients looks up the registry, gets the factory, invokes a method on that factory, and factory creates a remote object for the client.
Eugene.


Great news indeed. Thanks for helping me out and did i mention the patience.
 
For my next feat, I will require a volunteer from the audience! Perhaps this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic