David Harmon said:
No, it's a terrible idea. You should use the base class methods, or
implement them compatibly in the derived class. If that's impossible,
then the class isn't a proper subtype.
A derived type should never demand more or deliver less than the base
type.
Google for "Liskov Substitution Principle" or see
http://www.objectmentor.com/resources/articles/lsp.pdf
One of us doesn't understand the OP's post. I take it to mean (using an
example with fewer virtual functions):
class IThing
{
public:
virtual const std::string &name() const = 0;
virtual void op() = 0;
virtual ~IThing() {}
};
// partial implementation of IThing
class BThing : public IThing
{
private:
std::string m_name;
public:
BThing(const std::string &i_name) : m_name(i_name) {}
virtual const std::string &name() const {return m_name;}
virtual void op() = 0; // good style?
};
Anyway, I would say it is NOT good style because it appears you are
introducing a new function when you are not. However I wouldn't call it a
major mistake by any means.
Sometimes in this situation I list the unimplemented functions in comments,
but that can lead to maintainability issues (e.g. if I change the function I
have to make a parallel change in the comment).