[Exceptional C++ Style] Item 18 - Virtuality
Kevlin Henney
kevlin at curbralan.com
Sun Jan 9 05:05:54 EST 2005
In message
<C3571D9EA82596468B7C6D662C82B8240546F753 at RED-MSG-32.redmond.corp.microso
ft.com>, Herb Sutter <hsutter at microsoft.com> writes
>
>> Regardless of one's opinion of NVI, it is clear, from reading any of
>> Herb's material on the topic, that the goal is different. There is no
>> skeletal algorithm and there is one step that is delegated.
>
>Just a nit: Actually, the example I gave specifically points out that
>this allows the form of the function (including the number of distinct
>operations) to vary independently to best suit the audience (the outside
>world, or derived classes' customization hooks), and has multiple
>DoProcessPhaseN steps.
I think I mentioned in another posting that NVI can be refactored to TM,
and a TM certainly satisfies the basic non-public properties. In other
words, it would allow such a transformation, but it is not a necessary
part of it. There are also other ways of achieving such a transformation
-- other starting points that lead to the same end -- but other starting
points also suggest other different paths, such as those based on
delegation.
Kevlin
--
____________________________________________________________
Kevlin Henney phone: +44 117 942 2990
mailto:kevlin at curbralan.com mobile: +44 7801 073 508
http://www.curbralan.com fax: +44 870 052 2289
Curbralan: Consultancy + Training + Development + Review
____________________________________________________________
More information about the Effective-cpp
mailing list