Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!samsung!emory!wa4mei!nanovx!msa3b!kevin From: kevin@msa3b.UUCP (Kevin P. Kleinfelter) Newsgroups: comp.lang.c++ Subject: Re: Borland language extension virtual function = [ ... ]; Message-ID: <1691@msa3b.UUCP> Date: 29 Jun 91 12:25:44 GMT References: <1991Jun27.130247.5107@mathcs.sjsu.edu> <1991Jun27.210518.19589@Think.COM> <1991Jun28.022445.12167@mathcs.sjsu.edu> Organization: Dun and Bradstreet Software, Inc., Atlanta, GA Lines: 39 horstman@mathcs.sjsu.edu (Cay Horstmann) writes: >In article <1991Jun27.210518.19589@Think.COM> barmar@think.com writes: >>In article <1991Jun27.130247.5107@mathcs.sjsu.edu> horstman@mathcs.sjsu.edu (Cay Horstmann) writes: >[my tedious explanation of a nonstandard scheme in BC++ deleted...] >> [Description of poor speaker also omitted.] There were two speakers in the presentation on OjbectWindows and BC++. One was pretty good, and the other should not be permitted to speak in front of gatherings of more that 2 people! :-) >(2) As far as I can tell, this particular feature is extraordinarily poorly > thought out. There almost certainly are better ways of doing this that > don't require breaking the language. [I might be wrong; maybe the feature > is much more general and useful than it appeared. Does anyone know?] The feature changes the way the VTAB is created. When you have a derived class, which overrides only a few virtual methods from a base class with many virtual methods, BC++ normally gives you a whole new VTAB. When you use dynamically dispatched messages, the new VTAB is some kind of linked-list with a "cache." Thus you end up with a smaller VTAB at the expense of speed. In the case of windows (which may have MANY virtual methods), this seems like worthwhile tradeoff (IMHO). However, it appears that this feature is only useful if you purchase ObjectWindows. You cannot use the normal language syntax to call a function (aka "message") which has been declared in this maner. If anyone knows how to call a function declared in this manner, I'd be interested to know how. The feature may be useful beyond Windows. It would seem to be useful in any case where you have a base class with a large VTAB, and your derived class overrides only a few virtual methods. Unfortunately, if you can't call the method, only AbjectWindows will be able to use this extension. -- Kevin Kleinfelter @ DBS, Inc (404) 239-2347 ...gatech!nanoVX!msa3b!kevin Dun&Bradstreet Software, 3445 Peachtree Rd, NE, Atlanta GA 30326-1276