Posted By: zhuo | Jun 24th, 2006 @ 10:52 PM
page 1 of 1
Comments: 5 | Views: 7599
What's a proxy stub? When do you use it? Why do you use it?
Sven Groot
Sven Groot
My name has 9 letters. Coincidence? I think not...
A proxy stub doesn't exist. You probably saw it referred somewhere as proxy/stub, by which they mean proxy or stub.

A proxy is a piece of code that doesn't perform any functions of its own, but instead is responsible for calling the real code. For instance you can use wsdl.exe (or Visual Studio) to generate a proxy class for a webservice. This class doesn't perform the function of the webservice, but it's responsible for calling the webservice.

A stub is a placeholder, usually a class skeleton that you need to fill in yourself with real code. To again use the web service example: on the server you have a class using [WebService] that implements the service. Giving an existing WSDL contract, wsdl.exe can generate a stub for that service: a class that implements the service, but all the methods are empty leaving you to implement the functionality for real.

Both proxy and stub code is most often autogenerated, like in this example with wsdl.exe.
In COM, a proxy/stub is the code used to marshal data across boundaries like process boundaries or apartment boundaries.

To really understand this, I'd recommend Don Box's Essential COM.
I am a novice programmer, I am investigating windows, this is a guess.  The stubs aree in hex format, and pertain to objects, I think they call an action of the object, if you have ever coded in C you may know about namespaces from the wmi instrumentation or thier "datatypes" that are the arguments. . . all of these sit in the registry. . . any way I think the stub is some sort of argument, like "hey I have changed" or "im next look at me"
figuerres
figuerres
???
Sorry but that's not it at all.

a "Stub" is a file that shows what functions or methods will need to be implimented in order to fufill a contract.

an "Interface" and a "Stub" are simmilar but not the same.

think of it like this, from the abstract to the specific:

Idea

Specification

Interface

Stub

Class

-- an instance of the class used in a program.

depending on the programming language a stub may be "decorated" with terms / keywords like Virtual,Abstract,MustOverride or other terms that all lead back to the idea:
Here is a Non-working example of what you need, fill in the blanks.
also a BaseClass is more than a stub but might be used like a stub to help derive a certain veriation on a class.

I hope that makes it a bit clearer.

page 1 of 1
Comments: 5 | Views: 7599
Microsoft Communities