190 likes | 398 Views
Remote Procedure Calls. Based on Chapter 38 in Computer Networks and Internets, Comer. Procedure. A procedure (a.k.a. a method, a subroutine or a function) is a part of a program that performs a well-defined task.
E N D
Remote Procedure Calls Based on Chapter 38 in Computer Networks and Internets, Comer
Procedure • A procedure (a.k.a. a method, a subroutine or a function) is a part of a program that performs a well-defined task. • Procedures are used to break a complex problem down into more manageable pieces (divide and conquer). • Also a well-chosen procedure may be used repeatedly (re-use).
Procedural Control Flow • When the action defined by a procedure is required, it is called. • The “control” of the program is passed to the procedure. • Typically, while the procedure is performing its task, the program waits. When the procedure is done, control is passed back to whatever portion of the program called it.
Remote Procedural Call • The idea of a remote procedural call (RPC) is that • If an application is “distributed” then the procedure called may be executed on another machine. • To whatever extent possible, the details of connecting to the other machine should be “hidden” from the programmer.
Synchronous • When the procedure is local, control is passed to it. When the procedure is remote something similar must happen. • The calling of the remote procedure starts a communication session. The response (return value) is returned in the same session. • The interaction between the two programs is said to be synchronous when the calling routine is suspended or blocked until it receives an answer. • If the calling procedure does not have to wait, it’s called asynchronous.
RPC • By using RPC, an application programmer could avoid the tedious programming details required to make a connection between the calling program (client) and the remotely executed subroutine (server) and could focus on the application almost as if it were executed entirely locally.
Stub • The connection in a RPC is facilitated by using stubs. • Suppose one had a purely local version of the program, one replaces the local procedure with a stub, which serves as its substitute. • When the stub receives the control, it turns control over to another program (client runtime program) that takes responsibility for connecting to the remote procedure. • When completed, any return values and control are passed back to the stub and ultimately the program that called the stub.
Server Stubs and Communication Proxy • The remote procedure also has a stub that stands in for the calling program. • Like the client, the server has a runtime program that manages its side of the stub-to-stub interaction. • The calls to handle the pass and the response are developed by using a communication proxy. • A proxy is the set of instructions needed to handle the communication requirements.
Middleware • Middleware is the code that allows two applications to communicate. • It can be used to extend an application to a distributed system. • Middleware programming has shifted from the procedural paradigm to the object-oriented paradigm. The design uses objects and the set of operations which are performed on the objects (called the methods).
.NET • The latest Microsoft platform • The ambition of .NET is to seamlessly mesh applications and the internet • “The network is the computer” • .NET depends on four Internet standards: • HTTP • XML • SOAP • UDDI
.NET • There are four main principles of .NET from the perspective of the user: • It erases the boundaries between applications and the Internet. • Software will be rented as a hosted service over the Internet instead of purchased on a store shelf. • Users will have access to their information on the Internet from any device, anytime, anywhere. • There will be new ways to interact with application data, such as speech and handwriting recognition.
SOAP • Simple Object Access Protocol (SOAP) is a way for a program running in one kind of operating system (such as Windows 2000) to communicate with a program in the same or another kind of an operating system (such as Linux) by using the World Wide Web's Hypertext Transfer Protocol (HTTP) and its Extensible Markup Language (XML) as the mechanisms for information exchange.
SOAP • SOAP specifies how to encode an HTTP header and an XML file so that a program in one computer can call a program in another computer and pass it information. It also specifies how the called program can respond. • An advantage of SOAP is that program calls are much more likely to get through firewall servers that screen out requests other than those for known applications (through the designated port mechanism). • HTTP requests are usually allowed through firewalls.
UDDI • Universal Description, Discovery, and Integration is an XML-based registry for businesses worldwide to list themselves on the Internet. • Its ultimate goal is to make for efficient online transactions by enabling companies to find one another on the Web and make their systems interoperable for e-commerce. UDDI is often compared to a telephone book's white, yellow, and green pages. • A resource for brokers
UDDI Listings • White pages are for when you know the name of what you want. • Yellow pages are for when you know the type of service you want but don’t know the name. • Green pages provide details about code: its purpose, its interface, its cost, etc.
Other References • http://www.webopedia.com • http://www.whatis.com