Boost logo

Boost :

From: Bjarne Stroustrup (bs_at_[hidden])
Date: 2001-02-12 09:02:11


> Delivered-To: bs_at_[hidden]
> X-eGroups-Return:
sentto-1234907-6020-981961856-bs=research.att.com_at_[hidden]
> X-Sender: kevlin_at_[hidden]
> X-Apparently-To: boost_at_[hidden]
> To: boost_at_[hidden]
> From: Kevlin Henney <kevlin_at_[hidden]>
> MIME-Version: 1.0
> Mailing-List: list boost_at_[hidden]; contact boost-owner_at_[hidden]
> Delivered-To: mailing list boost_at_[hidden]
> List-Unsubscribe: <mailto:boost-unsubscribe_at_[hidden]>
> Date: Mon, 12 Feb 2001 06:59:07 +0000
> Subject: Re: [boost] generic programming reference page
> Content-Transfer-Encoding: 7bit
>
> In message <076a01c094a7$c08031d0$0500a8c0_at_[hidden]>, David
> Abrahams <abrahams_at_[hidden]> writes
> >I've checked in a preliminary generic programming techniques reference page
> >at more/generic_programming.html. You may want to place links into this page
> >in new boost documentation.
>
> Excellent!
>
> However, one quibble on accuracy: The page credits Andrei with the idea
> of Policy classes, which is not entirely true. The technique is an old
> one: It is described in both Booch's 2nd edition (published 1993), in
> the Gang of Four book (published 1994), and it is used in the C++
> standard, amongst other places.
>
> The Booch components used Policy classes to parameterise on a number of
> things, including locking strategy. GOF describe the Strategy pattern,
> which is also known as Policy, and they briefly describe the use of
> templates rather than inheritance. In the C++ standard library container
> allocators and the basic_string traits parameter (despite its name) are
> also policies.
>
> Kevlin

Exactly. Parameterizing with "policy" is as old as the mountains. I suggested
the idea of collecting various "policy" template arguments in the STL into "a
proper policy" to Alex, and I certainly didn't think that I was being original.
After discussions with Alex in the late eighties, it I had it as a specific
design requirement for templates that I should be able to parameterize
templates with operations that could be inlined (i.e. function objects). I have
been using the phrase "parameterizing with policy" and equivalents for a very
long time. I think (but I haven't done a literature seacrh) that I picked it up
from OS work at CMU in the seventies.

It is inevitable that we "reinvent to wheel" a bit, but it is important to take
a bit of care with references and credits not to be seen as ignorant or
predatory.

        - Bjarne
Bjarne Stroustrup, http://www.research.att.com/~bs


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk