#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    73
    Rep Power
    12

    "stubs" of class members?


    what does the term "stubs" mean in the context of class members?

    thanks for your time
  2. #2
  3. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,145
    Rep Power
    2222
    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?
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Location
    Flint, MI
    Posts
    328
    Rep Power
    12
    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.
    Clay Dowling
    Lazarus Notes
    Articles and commentary on web development
    http://www.lazarusid.com/notes/

IMN logo majestic logo threadwatch logo seochat tools logo