3.9. Defining a Derived Class
In general, a derived class needs to program only those aspects of its behavior that differ from or extend the behavior of its base class. NotQuery, for example, must provide an eval() definition that implements the not semantics. It must also introduce an instance member to store the query operand it is negating, and a property to allow get and set access to the operand, if appropriate. Both the AndQuery and OrQuery classes must support left and right operands. The NameQuery member must support a string member. All must provide definition of the abstract eval() virtual method.
The derived class is considered abstract if either it introduces an abstract member or it does not provide an implementation for an inherited ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access