This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

networking mode or stand-alone mode  RSS feed

 
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My B&S assignment spec. says:

the program must allow the user to specify the location of the database, and it must also accept an indication that a local database is to be used, in which case, the networking must be bypassed entirely.

I wonder what it means. Is this referring to the stand-alone mode, i.e., specified by command-line argument "alone", or is this referring to the network mode with server being the local host, i.e., server is //localhost. If it is the latter, how could I pass the networking layer entirely since the program is running in network mode, although the server happens to be localhost.

Thanks.
Yan
 
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
he networking must be bypassed entirely.

standalone mode should not use localhost. Implementation is entirely upto you. I just create an instance of the object implementing the Remote interface used for communication on the server side and pass it to the client side. Remember RMI to you(apart from dealing with the Remote exceptions and making connections) is just like calling on an object like it was on your computer.

When you use localhost its just like you were on two diffrent networks because communications go through RMI and the client and server run on two different VMs.
[ October 25, 2004: Message edited by: Inuka Vincit ]
 
Ranch Hand
Posts: 1033
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Yan Zhou:
My B&S assignment spec. says:

the program must allow the user to specify the location of the database, and it must also accept an indication that a local database is to be used, in which case, the networking must be bypassed entirely.

I wonder what it means. Is this referring to the stand-alone mode, i.e., specified by command-line argument "alone", or is this referring to the network mode with server being the local host, i.e., server is //localhost. If it is the latter, how could I pass the networking layer entirely since the program is running in network mode, although the server happens to be localhost.

Thanks.
Yan



The standalone mode MUST NOT use networking at all, it must access the database directly. What I do is have the Model access a DBAccess instance that is either a Data object or a DataProxy object the structure is:

Networked
Model -> DBAccess(DataProxy) -> DataAdapter --RMI--> DataAdapterImpl -> DBAccess(Data)

Standalone
Model -> DBAccess(Data)

The Model uses a Factory to produce the appropriate DBAccess instance. When RMI is used the Factory references a DataAdapterFactory that uses a single instance of DataAdapterFactoryImpl to provide instances on the server. This is the only object registered with the RMI registry.
 
Yan Zhou
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with you entirely.

I am just wondering, when the spec. says:" the program must accept an indication that a local database is used", is that talking about the "alone" command line argument or something else?

In other words, how would user indicate that a local database is used?
Thanks.
Yan
 
Ranch Hand
Posts: 531
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I implemented my program to take the parameter as that notice. I don't think it is necessary to provide this switch while the client is running...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!