Distribution Mechanisms in Java


As a young programming language conceived for use in networked environments from the outset, Java offers more options to realize distributed applications. After all, distribution means that bits and bytes are moved from one process to another over a network. This communication can be implemented in various abstraction layers:

  • From the Java perspective, the bottom layer is represented by sockets. A socket allows you to transmit uninterpreted data streams from one computer to another. All others build on this mechanism. Java's java.net package offers the infrastructure required for direct use of sockets.

  • From the programmer's perspective, another abstraction is more suitable: sending messages to remote objects. This mechanism is called Remote Method Invocation (RMI) and is included in Java's java.rmi package. However, RMI is limited to Java [1] and you have to know the location of a remote object or the registry's location.

  • Another way to abstract an object's location and the implementation language is Common Object Request Broker Architecture (CORBA). CORBA offers standardized interfaces to most programming languages and a large number of services for object management, searching, authentication, and more.

  • However, CORBA has lost a lot of its attractiveness since Sun introduced the Java-proprietary Enterprise JavaBean (EJB) standard. In addition to plain distribution, the EJB specification includes its own component model and considers other aspects like persistence, transactions, security, and scalability.

  • The Jini (Java Intelligent Networking Infrastructure) represents an infrastructure to provide, register, and find distributed services based on its specification [URL:Jini]. One integral part of Jini is JavaSpaces, a mechanism that supports distribution, persistence, and migration of objects in a network [Boger01].

RMI and EJBs are interesting representatives of their kind, thanks to their high abstraction level and their specialization for Java. For this reason, we will discuss below what unit testing can look like in the RMI and EJB environments. To follow the rest of this chapter you should know at least the basics of these technologies. [2]

[1]Well, not quite, because an RMI connection for IBM's VisualAge for Smalltalk is available.

[2]There is plenty of introductory material on the Web, including online tutorials for both RMI [URL:RMITutorial] and EJB [URL:EJBTutorial].




Unit Testing in Java. How Tests Drive the Code
Unit Testing in Java: How Tests Drive the Code (The Morgan Kaufmann Series in Software Engineering and Programming)
ISBN: 1558608680
EAN: 2147483647
Year: 2003
Pages: 144
Authors: Johannes Link

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net