Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2005

Tip: Looking for answers? Try searching our database.

RMI solution?

Thread view: 
ahmadraheel@gmail.com - 24 Mar 2005 08:20 GMT
I have a distributed application requirement which should have a
server listening for requests and a client sending an image and some
data to the server. The server on receiving this, does some
preprocessing and posts this to a database.

I was thinking of using RMI to do the sending from the client, but it
seems to be an overkill to use RMI just for sending data. Is there a
better solution using an alternate technology? Thanks!
Alex Molochnikov - 24 Mar 2005 08:35 GMT
> I have a distributed application requirement which should have a
> server listening for requests and a client sending an image and some
[quoted text clipped - 4 lines]
> seems to be an overkill to use RMI just for sending data. Is there a
> better solution using an alternate technology? Thanks!

You can use a floppy, or burn a CD.
ahmadraheel@gmail.com - 24 Mar 2005 15:32 GMT
I hope you were being serious.
Anyway, it is really a client/server situation in which there is a
constant stream (10/minute lets say) of message sending with the image
and meta-data. The data needs to be posted to the DB immediately.
Clearly your solution is an overkill as well as costly and time
consuming. But thanks though.
Alex Molochnikov - 24 Mar 2005 18:23 GMT
No, I am not being serious - just sarcastic. You didn't want to use RMI,
thinking it is an "overkill", so I offered the real overkill instead. Any
solution other than the RMI would be even harder to implement. E.g., a
direct socket-to-socket connection, or JMS, or packaging your server as an
EJB and running it inside an application server etc.

In my experience, RMI is suited for the data exchange just fine.

> I hope you were being serious.
> Anyway, it is really a client/server situation in which there is a
> constant stream (10/minute lets say) of message sending with the image
> and meta-data. The data needs to be posted to the DB immediately.
> Clearly your solution is an overkill as well as costly and time
> consuming. But thanks though.
ahmadraheel@gmail.com - 24 Mar 2005 20:44 GMT
Thanks for your comments Alex.
Makes sense, except - Why is a direct socket-socket connection harder
to do than RMI? Would it not be easier to do?
Alex Molochnikov - 24 Mar 2005 21:23 GMT
With the socket-to-socket connection you have to:

1. create an anchor (server) socket on the server side
2. create the connecting socket in the client
3. organize the read/write loops with blocking i/o
4. serialize and de-serialize your data (if it includes objects)

With the RMI, you only need to create a server object, bind it to the
registry and export it on the selected port (equivalent of 1 in the s-s
scenario). You also have to create the RMI stubs by running rmic, but this
can be done once in a script/bat file, and put the Naming.lookup code in
your client (equivalent of 2). After that, you are free to send/receive any
data through simple method calls, without worrying about serialization, i/o
etc. Items 3 and 4 in the s-s version are gone.

RMI is a higher-level abstraction of the socket mechanism, with lots of
mundane socket stuff hidden, and lots of convenience wrapping added.

Decide for yourself, which is easier. Or, if in doubt, try the sockets
first, and it won't be long before you quit and turn to the RMI.

> Thanks for your comments Alex.
> Makes sense, except - Why is a direct socket-socket connection harder
> to do than RMI? Would it not be easier to do?
ahmadraheel@gmail.com - 25 Mar 2005 01:39 GMT
Thanks. It does make sense.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.