How to know what's a stub?
Does stub always mean the same thing when you write programs?
"Stubs provide replacement implementations for objects, methods, or functions in order to remove external dependencies. Stubs are typically used during unit and component testing. If you're trying to write a unit test and need to replace a simple call to a database, external libraries (e.g., file I/O) or other system API, stubbing might be perfectly suited for your needs."
I thought stub and skeleton were only in CORBA but here there's a stub and is that the same thing/concept? A coiincidence or a connection when the word "stub" appears in rather different programming models (RMI and MIPS assmebly are 2 rather different) both have the concept / thing called "stub" and I also know for RMI / CORBA there's something called the skeleton but it's also possible to have a stub without a skeleton or what?
For instance when main is translated to assembly it's called a stud here and is there a connection to that stub and skeleton are used in network programming such as CORBA or is it no connection despite both are called stub?
movia r8,stub # source movia r9,0x800020 # destination ldw r10,0(r8) # read stw r10,0(r9) # write ldw r10,4(r8) # read part 2 stw r10,4(r9) # write ldw r10,8(r8) # read jump stw r10,8(r9) # write ... # initialize others
Is the code above an exmple of a stub? If so, what would be a skeleton or is that not applicable?
Thanks for info.
CORBA and RMI stub is a quite specific object that locally represents a certain remote object. This object exists on server side and the stub exists on a client side. The stub implements the same interface (has same working methods), forwarding all calls to the remote object, also receiving returned results and exceptions. Stub class is normally often automatically generated.
Stub in general has a different meaning (something that is only half finished, often just enough to make the code to compile but not to run properly).