Skip to document

Models of interaction

Models of interaction
Course

Software Engineering (CSPC 111)

140 Documents
Students shared 140 documents in this course
Academic year: 2022/2023
Uploaded by:
Anonymous Student
This document has been uploaded by a student, just like you, who decided to remain anonymous.
Don Mariano Marcos Memorial State University

Comments

Please sign in or register to post comments.

Preview text

Models of interaction

Two fundamental types of interaction may take place between the computers in a distributed computing system: procedural interaction and message-based interaction. Procedural interaction involves one computer calling on a known service offered by some other computer and waiting for that service to be delivered. Message-based interaction involves the “sending” computer defining information about what is required in a message, which is then sent to another computer. Messages usually transmit more information in a single interaction than a procedure call to another machine.

To illustrate the difference between procedural and message-based interaction, consider a situation where you are ordering a meal in a restaurant. When you have a conversation with the waiter, you are involved in a series of synchronous, procedural interactions that define your order. You make a request, the waiter acknowledges that request, you make another request, which is acknowledged, and so on. This is comparable to components interacting in a software system where one component calls methods from other components. The waiter writes down your order along with the order of other people with you. He or she then passes this order, which includes details of everything that has been ordered, to the kitchen to prepare the food. Essentially, the waiter is passing a message to the kitchen staff, defining the food to be prepared. This is message-based interaction.

I have illustrated this kind of interaction in Figure 17, which shows the synchronous ordering process as a series of calls, and in Figure 17, which shows a hypothetical XML message that defines an order made by the table of three people. The difference between these forms of information exchange is clear. The waiter takes the order as a series of interactions, with each interaction defining part of the order. However, the waiter has a single interaction with the kitchen where the message defines the complete order.

Procedural communication in a distributed system is usually implemented using remote procedure calls (RPCs). In an RPC, components have globally unique names (such as

a URL). Using that name, a component can call on the services offered by another component as if it was a local procedure or method. System middleware intercepts this call and passes it on to a remote component. This carries out the required computation and, via the middleware, returns the result to the calling component. In Java, remote method invocations (RMIs) are remote procedure calls.

Remote procedure calls require a “stub” for the called procedure to be accessible on the computer that is initiating the call. This stub defines the interface of the remote procedure. The stub is called, and it translates the procedure parameters into a standard representation for transmission to the remote procedure. Through the middleware, it then sends the request for execution to the remote procedure. The remote procedure uses library functions to convert the parameters into the required format, carries out the computation, and then returns the results via the “stub” that is representing the caller.

Message-based interaction normally involves one component creating a message that details the services required from another component. This message is sent to the receiving component via the system middleware. The receiver parses the message, carries out the computations, and creates a message for the sending component with the required results. This is then passed to the middleware for transmission to the sending component.

A problem with the RPC approach to interaction is that both the caller and the callee need to be available at the time of the communication, and they must know how to refer to each other. In essence, an RPC has the same requirements as a local procedure or method call. By contrast, in a message-based approach, unavailability can be tolerated. If the system component that is processing the message is unavailable, the message simply stays in a queue until the receiver comes back online. Furthermore, it is not necessary for the sender to know the name of the message receiver and vice versa. They simply communicate with the middleware, which is responsible for ensuring that messages are passed to the appropriate system.

Was this document helpful?

Models of interaction

Course: Software Engineering (CSPC 111)

140 Documents
Students shared 140 documents in this course
Was this document helpful?
Models of interaction
Two fundamental types of interaction may take place between the computers in a
distributed computing system: procedural interaction and message-based interaction.
Procedural interaction involves one computer calling on a known service offered by
some other computer and waiting for that service to be delivered. Message-based
interaction involves the “sending” computer defining information about what is required
in a message, which is then sent to another computer. Messages usually transmit more
information in a single interaction than a procedure call to another machine.
To illustrate the difference between procedural and message-based interaction,
consider a situation where you are ordering a meal in a restaurant. When you have a
conversation with the waiter, you are involved in a series of synchronous, procedural
interactions that define your order. You make a request, the waiter acknowledges that
request, you make another request, which is acknowledged, and so on. This is
comparable to components interacting in a software system where one component calls
methods from other components. The waiter writes down your order along with the
order of other people with you. He or she then passes this order, which includes details
of everything that has been ordered, to the kitchen to prepare the food. Essentially, the
waiter is passing a message to the kitchen staff, defining the food to be prepared. This
is message-based interaction.
I have illustrated this kind of interaction in Figure 17.1, which shows the synchronous
ordering process as a series of calls, and in Figure 17.2, which shows a hypothetical
XML message that defines an order made by the table of three people. The difference
between these forms of information exchange is clear. The waiter takes the order as a
series of interactions, with each interaction defining part of the order. However, the
waiter has a single interaction with the kitchen where the message defines the complete
order.
Procedural communication in a distributed system is usually implemented using remote
procedure calls (RPCs). In an RPC, components have globally unique names (such as