Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Hamlet

Binding and Late Binding

This topic is 5996 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Can anyone provide a good definition for binding and late binding? I have searched my book and there seams to be no concrete definition. The book is "How to program C++" by Deitel and Deitel. Thanks "... thats the rub...

Share this post


Link to post
Share on other sites
Advertisement
Late binding refers to virtual functions (in C++ anyway), which means what function is invoked isn''t decided until run-time.

Binding is the term used to describe the process of resolving a function name to actual code.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Note that there are two kinds of binding. With early binding, you define your object as a certain one and all class ids are compiled with your program. This makes it faster to run but comes with a risk. If the class you are using might change in the future and not be binary compatible anymore (such as Microsoft does everytime they update their dang Excel and Word objects, 9 is not compatible with 8) then your compiled program will get run-time automation errors. If you use late binding, the class ids are obtained at run-time, which is slower, but you end up avoiding the headache. I hope I made sense, it''s different to know something and to be able to explain it, and I think I lack the latter...

Share this post


Link to post
Share on other sites
There''s more than two kinds of binding, but the different kinds are often called the same thing.

The office automation binding can either be late or ''dynamic'', it can use virtual functions or IDispatch (kinda like script execution). Sometimes virtual functions are considered early binding - usually when you''re talking about IDispatch or similar "very late" dynamic binding.

Magmai Kai Holmlor

"Oh, like you''ve never written buggy code" - Lee

[Look for information | GDNet Start Here | GDNet Search Tool | GDNet FAQ | MSDN RTF[L] | SGI STL Docs | STFW | Asking Smart Questions ]

[Free C++ Libraries | Boost | ACE | Loki | MTL | Blitz++ ]

Shamelessly ripped from Oluseyi

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!