News for hackers. Stuff that matters.
Re:The impoliteness of overriding methods by cpeterso on Wednesday December 19, 2012 @04:25PM (#4944940)
Overriding virtual functions is a huge hole in information hiding.

In C++, the "Non-Virtual Interface" (NVI) design pattern recommends that interface classes declare nonvirtual public functions that delegate to private pure virtual functions to be implemented by derived classes. A base class destructor should be either public and virtual, or protected and nonvirtual. NVI allows the base class to add pre- and post-condition assertions to test the derived implementation classes. NVI should also alleviate the "fragile base class" problem with C++ binary compatibility.

https://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Non-Virtua...

There are no comments on this comment yet.