August 29th, 2003, 03:51 PM
"stubs" of class members?
what does the term "stubs" mean in the context of class members?
thanks for your time
August 29th, 2003, 05:31 PM
I'm not sure of the context you are refering to, but stubbing in code is the practice of creating functions which as yet do nothing and return default values. By so doing, you allow function calls to be made and all the necessary linking to succeed so that you have can create the overall structure of the program very early on without having to wait until all of those functions have been coded. Then you can go back and implement the individual functions.
Another benefit of stubbing functions is that you can place the functions calls where they belong from the start, rather than waiting until much later when you finally get around to implementing that function and having to remember at that time everywhere those function calls need to be made.
A third use I have found is when you are modifying existing code and you need to remove an existing function which is no longer applicable. Rather than remove it and remove all calls to it, including rewriting code that requires making large-scale changes to the program's structure (believe me, I've seen where that would have been necessary), simply stub out the function so that it would do nothing and have it return an innocuous value.
Does that sound like what you were asking?
August 29th, 2003, 07:55 PM
Additional meaning: Shared objects come in two parts. They include the library proper where the functions are implemented, and smaller library which consists just of stubs that will call the function in the implementation of the library.
Articles and commentary on web development