RMI design help

S

Sn0tters

Hi,

I am looking for some design help.

I am thinking of developing an app that will use a UI on a separate
thread.

I want the UI to just be event driven and not to do any real
processing.

Now the thing is I want the UI to, obviously, respond to the user and
send requests to the server, but I also want the server to be able to
send request to the UI to ask the user for information.

Is it valid to create a two way RMI interface or do I need to create
two separate instances of interfaces, or more importantly, is RMI the
best way to do this?


Thanks for any advice
Wil
 
I

iksrazal

RMI has good performance but requires port 1099, ie, firewall problems.
On a local subnet, should be fine. You could use web services which run
on port 80/8080, but, will require accepting a slight performance hit
due to that http is slower.

Look at the Observer and Proxy patterns to see if that answers your
other questions.

HTH,
iksrazal
http://www.braziloutsource.com/
 
N

Nigel Wade

Hi,

I am looking for some design help.

I am thinking of developing an app that will use a UI on a separate
thread.

The UI should run on the Event Dispatch Thread.
I want the UI to just be event driven and not to do any real
processing.

That makes sense, it's the way it's meant to be done.
Now the thing is I want the UI to, obviously, respond to the user and
send requests to the server, but I also want the server to be able to
send request to the UI to ask the user for information.

That means you will need to introduce other threads. For the UI to send
requests to the server it should really run a processing thread to do this.
For the UI to be able to receive requests from the server it will have to
have a thread running a RMI server which is registered with the
rmiregistry.
Is it valid to create a two way RMI interface or do I need to create
two separate instances of interfaces, or more importantly, is RMI the
best way to do this?

I think you ought to have two interfaces. An RMI server implements an
interface and therefore your server and UI would both have to implement
each method of the two-way interface. This would be confusing for you, the
rmiregistry, the UI and server.

As to whether RMI is the best way to implement this, that's something you'll
have to determine yourself when you weigh-up other alternatives.
 
S

Steve W. Jackson

RMI has good performance but requires port 1099, ie, firewall problems.
On a local subnet, should be fine. You could use web services which run
on port 80/8080, but, will require accepting a slight performance hit
due to that http is slower.

Look at the Observer and Proxy patterns to see if that answers your
other questions.

HTH,
iksrazal
http://www.braziloutsource.com/

RMI defaults to port 1099, but it does not require it. We've got a
recently developed app using JNDI with the actual service provider under
it being RMI, and we deliberately chose a port other than 1099 since
other parts of one application in the communications mix *may* be using
RMI on the default port for other purposes.

= Steve =
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top