Re: Client Server like program, which way is better?



Kevin wrote:

Sorry I am really new to "network" things. :-D

There is a task like:
previously, the program does a lot of IO and calculation and shows them
out. All on the same machine in one piece code. Since the IO and
calculation is very very time (and memory) consuming, now it is asked
the possibility of doing it in the "client-server" way:

So I hope it can work like this:
1) client sends server of "job ABC": which files to load and how to
calculate them and where to save them. Please note the files are never
transfered over the network. They are always read/saved on the server
side.
2) server side does the job (IO, calculation) and when done, sends
something back to the client to inform the client "job ABC is done".
3) then the client can retrieve the results from server for display.
(The results are just some numbers so should be fast over the network).

For this application, which architecture / packages / classes should we
use? It would be very useful if someone can write a "pseudo" code so
that I can know which methods to use are best in terms of efficiency as
well as easy to code. And a set of keywords so that I can google them
for the details. Also, is the simple examples from sun's site:
http://java.sun.com/docs/books/tutorial/networking/sockets/clientServer.html
good for real applications such as the one I need? (I am guessing a lot
of "hello world" applcations are really not that good in real world)

As the above task, any pitfalls, shortcuts, known bugs or issues, or
anything else that should pay special attention?

Thank you a lot!

I'd start by looking at remote method invocation (RMI). This is a classic case
of remote execution. RMI handles the serialization of the request objects sent
to the server, performs some operation and returns the results.

I'd have thought that Sockets would be too low a level to begin with. You could
do it with Sockets, but RMI provides you with a higher level of abstraction.
This allows you to concentrate your effort on the client/server logic without
having to worry about the nitty gritty details of the network protocols.

--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@xxxxxxxxxxxx
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
.



Relevant Pages

  • Re: RMI client behind a firewall, server behind a firewall too
    ... public class HelloImpl implements Hello{ ... RMI is written for use in an Intranet. ... > The web server on either side isn't the same as the machine running ... > the RMI client or server. ...
    (comp.lang.java.programmer)
  • Re: Client Server like program, which way is better?
    ... the program does a lot of IO and calculation and shows them ... They are always read/saved on the server ... something back to the client to inform the client "job ABC is done". ...
    (comp.lang.java.programmer)
  • RMI between Java 1.4 and Java 1.5 problem
    ... Handler (no security manager: RMI class loader disabled) ... The 1.4 client will connect to the 1.5 server if I ... the rmi interface is very simple. ...
    (comp.lang.java.programmer)
  • Re: Possibilities with RMI
    ... > which connects to an overall server. ... the server must know what port the client is ... > out various different objects that implement a set interface. ... > like these sent over RMI, ...
    (comp.lang.java.help)
  • Strange RMI failure
    ... I wondering whether anyone can give me a lead on a strange RMI failure. ... After successfully retrieving a remote object stub from the RMI ... server, the client receives a java.rmi.ConnectException when it tries to ... An identical copy of the client worked successfully against a different ...
    (comp.lang.java.programmer)