Re: [Libxmlplusplus-general] coding style issues
- From: murrayc t-online de (Murray Cumming)
- To: libxml++ <libxmlplusplus-general lists sourceforge net>
- Subject: Re: [Libxmlplusplus-general] coding style issues
- Date: 31 Jan 2003 18:05:27 +0100
On Fri, 2003-01-31 at 17:57, Stefan Seefeld wrote:
> 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'.
OK. I see now that this is connected to your use of private member data,
and that it was therefore forced on you by the libxml API.
> 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...
Then you could make that change later without confusing it with the
purpose of this patch, without any great disadvantage. It's not a reason
to do it now.
--
Murray Cumming
murray usa net
www.murrayc.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]