[bind10-dev] Data Source class design (mixing interface and implementation)
Evan Hunt
each at isc.org
Tue Feb 2 17:40:50 UTC 2010
> Anyway, as I was crossing the UK, I read "Item 34: Differentiate between
> inheritance of interface and inheritance of implementation". As I
> understand it, the basic point is that it is bad to have classes that
> allow *implicit* default behavior. This is exactly the design for the
> data source as I understand it.
See branches/parkinglot/src/lib/auth/cpp.
We actually chose kind of a hybrid approach. There's AbstractDataSrc,
which only has API definitions, as the book seems to be recommending.
DataSrc inherits the API and implements *some* of it at a high level
(specifically runQuery(), getclass() and setClass()). The rest is left
to be implemented by lower-level data sources.
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.
eh
More information about the bind10-dev
mailing list