Re: DYNAMIC - overload?

2006-03-12 09:05:28 AM
At 14:46:26, 10.03.2006, masi wrote:

1) what does exactly mean the word DYNAMIC that i must type when for
example i want to modify the standard handler of an event like
Dynamic is a special kind of virtual, first defined for the Turbo Pascal
compiler, when dat segments were limited, and virtual tables of, for
instance, the Turbo Vision framework could easily gobble up all the 64k
available. So Borland defined some kind of slower, but less memory
consuming virtual method table, the dynamic method table.
It does not contain a long list (indexed array) of ALL the function
pointers, which can immediately be accessed by looking at a certain
index, for each class. Instead, it contains only the methods the class
overrides, and the associated index value (i.e. it is an associative
array). Like for virtual methods, the function pointer is found at
runtime, but of course, this takes longer, since it requires a search
through all indices in the DMT (I guess they are sorted, so this could
perhaps be done with a binary search) to see if the function is defined
there. If it is not, the compiler will continue with the direct ancestor,
and so on, until it is finally found. That is MUCH slower, of course.
It is still in use for functions that are not so often overridden. A left
over from the Delphi 1 and Turbo Pascal days.
BCB has extensions that allow it to use such dynamic methods as well.
Rudy Velthuis [TeamB]
"I am ready to meet my Maker. Whether my Maker is prepared for the
great ordeal of meeting me is another matter." -- Winston Churchill.