[bind10-dev] Data Source class design (mixing interface and implementation)

JINMEI Tatuya / 神明達哉 jinmei at isc.org
Fri Feb 5 22:07:39 UTC 2010


At Tue, 2 Feb 2010 17:40:50 +0000,
Evan Hunt <each at isc.org> wrote:

> So those are the only three functions that have implicit default behavior,
> and I think it's a reasonable design as it is, but I'd be curious to hear
> more about the book's reasons for recommending against it.

This is about when we find the error if we needed to override the
default behavior but forgot it.  With the implicit default behavior,
we can only notice that run-time, while the explicit default behavior
+ pure virtual have us notice it at compilation time.

I believe we all agree compile time errors are much more preferable
than run-time unexpected behaviors, so I think Meyers' argument on
this point is quite convincing in general.

From a more high level point of view, virtual functions overload two
different semantics: defining interfaces and providing default
behaviors, and mixing them is often considered a bad design.  But, as
with many design related issues, this could be a more controversial
discussion.

---
JINMEI, Tatuya



More information about the bind10-dev mailing list