Distributed systems
Do you *need* to maintain the state of the  bar  variable when serializing/deserializing
Foo? If not, simply declare  bar  as  transient  and it will be ingored during
serialization.
 RMI versus Socket communication
I wish to get Java talking to C++ across a network.
Does anyone have any thoughts in terms of performance, ease of development etc. 
in :
Wrapping the C++ side with JNI and using RMI for the communications.
versus
Writing sockets code and communicating via http?
Answer: It depends of what kind of application you re writing but l think about
the following :
  with RMI you can have remote REFERENCE instead of having to transfer all the
object through the network. The object has just to implement Remote. So it spare
bandwith and is good for performance. This is impossible to do if you do through a
socket connection, you ve to send the all object.
  You ve not to take in charge the serialization (which could be not so easy
depending of your object structure), neither the connections, etc... All of that is taken
in charge by RMI.
  the performance are GOOD (even a bit more than that)  
three good points to use RMI, isn t it?
The difficulty added by RMI is the configuration of both client and server (distribution
of stubs, rmiregistry, what s happen if firewall). Depending of the environment all of
that can be either easy or complicate.
But once that all of that is in place you can extend your application
easily, so it s much more flexible and scalable.
If your needs are small perhaps that you could do your own connection system (but
for me it s less scalable and more bandwith consuming and so less performant).
  
Francois Malgreve
Answer2: I have done both. If your communication scenarios are diverse and could
keep changing, using a remote technology like RMI can help. If the operations are
few and/or not likely to change you can save the JNI complexity. Not that it is really
hard it just can be fun keeping the JNI code in sinc  with the C++ code.
  
Bret Hansen
Q: I need to communicate some data (string) from a Java Applet to an other ASP
page in the same frameset. I would like to avoid a server roundtrip and do it all with
JavaScript if possible.
Therefore I would like to call some javascript from a Java Applet. It looks like it is not
possible without a netscape package. Is that true? Is there a simple implementation
of the same functionality (source code) which I could incorporate in my applet?
Answer: Those Netscape packages are part of the current VM of both Microsoft IE 4+
and Netscape 4+. So, by adding the MAYSCRIPT tag to your Applet declaration, in
the Java code you can obtain a handle to the document and call functions in it.
by Tom Hall
file:///F|/a_jsite/350_tips/distributed_systems.htm (2 of 3) [2001 07 08 11:24:48]






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

java web hosting

 

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved