派发机制、动态绑定、静态绑定

Normally, in a typed language, the dispatch mechanism will be performed based on the type of the arguments (most commonly based on the type of the receiver of a message). This might be dubbed 'per-type dynamic dispatch'. Languages with weak or no typing systems often carry a dispatch table as part of the object data for each object. This allows instance behaviour as each instance may map a given message to a separate method.

 

c++是静态绑定

 

Late binding, or dynamic binding,[1] is a computer programming mechanism in which the method being called upon an object or the function being called with arguments is looked up by name at runtime.

With early binding, or static binding, in an object-oriented language, the compilation phase fixes all types of variables and expressions. This is usually stored in the compiled program as an offset in a virtual method table ("v-table") and is very efficient. With late binding the compiler does not read enough information to verify the method exists or bind its slot on the v-table. Instead the method is looked up by name at runtime.

 

https://www.cnblogs.com/feng9exe/p/8309575.html

https://www.cnblogs.com/feng9exe/p/8309568.html

posted @ 2018-09-19 12:14  zzfx  阅读(290)  评论(0编辑  收藏  举报