|
Boost : |
From: David Allan Finch (sarum_at_[hidden])
Date: 2000-08-17 10:51:58
jsiek_at_[hidden] wrote:
> I have a suggestion for the boost programming guidelines. As various
> boost members have pointed out in the past (most recently Dave), it is
> better to use free (non-member) functions over member functions in
> public interfaces.
I am probably a lone voice in the wilderness on but I
view that Coplin's (?) original analysis of this problem
is incorrect and hence his derived solution is incorrect
to.
His premises is that if you have a complex class you
can't extend it because you do not have access to
the fundamental fields. Hence it is better to have
access to a smaller set of methods and
have complex functionality at namespace level.
This is an incorrect (IMHO) conclusion. If you
look at any real world physical implementation
of a system, you will find that the complex functionality
is rapped up in a new level of system. I.E. controllers.
One of the classic problems that is used to show
why there is a problem is extending the String
class. IMHO the problem is that the String
class is to complex and should have been implemented
as a controller of a StringBuffer. You would then
write your own String Manipulator or extend String
to change the String Buffer how you wished it to be
modified.
-- / The whole history of this invention has been a struggle /\|/\ against time - Charles Babbage 1837 on the Analytical Engine | K | All Hail Discordia - Burn all Orange Books! \___/ david.allan_at_[hidden] - http://www.ironfort.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk