Re: [Libxmlplusplus-general] coding style issues
- From: Stefan Seefeld <seefeld sympatico ca>
- To: libxmlplusplus-general lists sourceforge net
- Subject: Re: [Libxmlplusplus-general] coding style issues
- Date: Fri, 31 Jan 2003 11:57:58 -0500
Murray Cumming wrote:
On Fri, 2003-01-31 at 17:13, Stefan Seefeld wrote:
2) 'using foomethod;' in derived class declaration:
Murray suggests people may not be familiar with that concept.
The goal of this shortcut is to drag base class methods into the
derived class. A more lengthy way would be to write
'foomethod() { BaseClass::foomethod();}
I don't see the point of this if the base class's implementation isn't
even used by the base class. I would just put the implementation in the
derived class where it's public. The public API would not be any
different and the implementation would be simpler.
Again, it's a matter of encapsulation. It's the base class that knows
how to implement 'foomethod'. You don't define methods in class A
because class A itself uses them, but because someone else may want to
call 'foomethod' *on* an object of type 'A'. (in our case that 'user' is
the derived class.
Besides, as I noted in the patch manager thread, I can see a future
change in libxml++ where we only have a single 'Node' base class
providing complete access to the full libxml2 node API, but in terms of
'xmlChar *', not 'std::string', and then make the concrete node types
templates. Thus it's really a matter to keep the code simple to
concentrate it in xmlpp::Node...
Regards,
Stefan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]