Wikipedia says
A stub in distributed computing is a piece of code that converts parameters passed between client and server during a remote procedure call (RPC)
How does the original meaning of the word stub
relate to its function in RPC?
Wikipedia says
A stub in distributed computing is a piece of code that converts parameters passed between client and server during a remote procedure call (RPC)
How does the original meaning of the word stub
relate to its function in RPC?
A stub is a short part of a whole, like a ticket stub or the stub remnant of a used pencil. Equivalently it is something "cut short." In computing, the stub looks like the method, but doesn't have the method's logic. The method's processing is "cut short" in that much of it is missing. The stub term is also used for "test stubs" (a.k.a. mocks) and "method stubs". Some people may call them "stand ins" instead.
Test stubs are commonly seen, but you may not be as familiar with method stubs. Method stubs are barely-implemented methods that have the proper arguments and return the right type of value but don't have the appropriate processing. For example, a stub for a random()
function could always return 4
. They are common in emulators and when initially implementing a system.
For RPCs, the stub converts its methods, request types, and response types into the forms used by the RPC system. But the actual processing of the RPC is done remotely. The stub is essentially just a usability feature to provide the appearance the remote method is present locally.
© 2022 - 2024 — McMap. All rights reserved.