Java Reference
In-Depth Information
Figure 16.1 A conceptual model for a simple client/server distributed application.
diagrams in UML. One is the sequence diagram, which shows the order in which
messages are sent between objects as well as an object's life cycle - i.e. creation
and termination.
The other UML interaction diagram is the collaboration diagram. (The col-
laboration diagram has been renamed communications diagram in UML 2.0.)
Collaboration diagrams are useful for visualizing the relationship between objects
collaborating to perform a particular task. They illustrate the order and flow of
messages between objects or, using Java terminology, the invocation of methods.
By thinking about how objects collaborate, one learns the behavior required by
each object - i.e., the methods that each class must provide. That is, collaboration
diagrams help one design the classes that will appear in the class diagram.
Sequence diagrams seem to be utilized far more often than collaboration
diagrams by most UML practitioners. For our purpose here, however, we find the
collaboration diagram to be the more useful of the two. In actuality, sequence
diagrams and collaboration diagrams show nearly the same information; they just
present it differently. The two are so closely related that some modeling tools,
such as Rational Rose, can automatically create a collaboration diagram from a
sequence diagram and vice versa [13]. We use collaboration diagrams below and
say nothing more about sequence diagrams.
16.4 A conceptual model for a simple
distributed application
We consider a simple distributed application in which a client sends input data
to and receives output data from a server object. A conceptual model of this
client/server application would be simple, as shown in Figure 16.1.
This system is considered to be a distributed application since the client and
server are on different machines although it is possible to run both client and
server applications on the same physical machine in two separate JVMs. One
might think that this diagram is almost too simple to be useful, but we build on
it below.
Search WWH ::




Custom Search