Presentation is loading. Please wait.

Presentation is loading. Please wait.

Distributed Java Communications Eric Lind CS522 Semester Project December 9, 2002.

Similar presentations


Presentation on theme: "Distributed Java Communications Eric Lind CS522 Semester Project December 9, 2002."— Presentation transcript:

1 Distributed Java Communications Eric Lind CS522 Semester Project December 9, 2002

2 How does one distribute using Java? Many different methods are available Many different methods are available Sockets Sockets RMI RMI CORBA CORBA XML (SOAP or JAX) XML (SOAP or JAX)

3 How do I decide which to use? Each new trend claims to be faster/stronger/better Each new trend claims to be faster/stronger/better Can be hard to compare different methods Can be hard to compare different methods Numbers are hard to come by Numbers are hard to come by  Which numbers to use?

4 Project Benchmarks Use a simple chat application Use a simple chat application  Contrived, yes, but still demonstrates features of each method Measure data written and read by each client or server Measure data written and read by each client or server Not concerned with low-level traffic, but with the application level data. Not concerned with low-level traffic, but with the application level data.

5 Sockets ServerClient Port Connection Request Bi-Directional Connection

6 Sockets Advantages: Advantages:  Nearly universal  Uses the smallest amount of data to communicate  Bi-directional Disadvantages:  Pretty low-level  Must do many things by hand  No additional services provided

7 RMI RMIChat Port Obtain Remote Reference Registry Obtain Remote Reference receive(Message) Each RMIChat object must implement both the client and server interface

8 RMI Advantages: Advantages:  Standard Java API  Allows remote objects to be treated as if local  Includes some services Disadvantages:  Uses client-pull (clients must also be servers for 2- way comm.)  Setup code is cumbersome  Marshalling is slow

9 CORBA CORBAChat As with RMI, each CORBAChat object must act as both client and server ORB IIOP

10 CORBA Advantages: Advantages:  Open standard  Many platforms / languages  Provides additional services  Generally faster than RMI Disadvantages:  Not “Java-friendly”  Uses client-pull  Tends to be trickier than other methods  Had considerable trouble with generated classes

11 Tomcat (or any Servlet- enabled Web Server) JAX-RPC JAXChat Stubs Runtime JAXChat Stubs RuntimeChat Service Ties Runtime HTTP SOAP Message

12 JAX-RPC Advantages: Advantages:  Uses SOAP (can talk to non-Java platforms)  Very easy to develop  Uses HTTP (eases security concerns) Disadvantages:  Uses SOAP (XML is very verbose)  Requires web server  Restricts data that can be sent  Still buggy

13 Benchmark Results

14 Conclusions Sockets have the lowest overhead Sockets have the lowest overhead RMI does not add much (only 43 extra bytes) RMI does not add much (only 43 extra bytes) XML adds a lot of overhead (19 times) XML adds a lot of overhead (19 times)  Must convert binary data to text  SOAP envelope is huge

15 Conclusions (cont.) RMI is probably the best for pure-Java applications RMI is probably the best for pure-Java applications Low overhead Low overhead Normal Java semantics Normal Java semantics RMI over IIOP should put RMI on par with CORBA for speed. RMI over IIOP should put RMI on par with CORBA for speed.

16 Conclusions (cont.) Web Services are (supposedly) platform neutral Web Services are (supposedly) platform neutral Good model for general data access, not so good for bandwidth constrained applications Good model for general data access, not so good for bandwidth constrained applications CORBA is still the only viable, cross- platform communications protocol, but it’s not easy to use CORBA is still the only viable, cross- platform communications protocol, but it’s not easy to use


Download ppt "Distributed Java Communications Eric Lind CS522 Semester Project December 9, 2002."

Similar presentations


Ads by Google