Boost logo

Boost :

From: andrewalex_at_[hidden]
Date: 2001-02-12 21:47:27

--- In boost_at_y..., Bjarne Stroustrup <bs_at_r...> wrote:
> > From: Kevlin Henney <kevlin_at_c...>
> > However, one quibble on accuracy: The page credits Andrei with
the idea
> > of Policy classes, which is not entirely true.

> Exactly. Parameterizing with "policy" is as old as the mountains.

Many thanks to Dave Abrahams for letting me know of this conversation.

Indeed I am guilty of presenting the technique without giving credit
where credit is due. I will tell you how things went, and I will
leave it to you to be judges.

I was aware that collecting design decisions in template parameters
is an old idea, but I had't seen it really put to good use in
industrial designs until I read "Generative Programming" this summer.
(I had written the paper in April.) The other example of using policy
classes for generic programming was STL's allocators but they aren't
that good of an example for various reasons.

I wanted to write really flexible, configurable components and I have
tried many solutions, until these things revealed themselves as the
most natural, easy to understand, and easy to use. But I had a couple
of problems:

1. They didn't have a name. It's very awkward to write a number of
generic components and a book that are based on "collecting design
decisions in classes and pass those classes to a template class as
template arguments". I needed to fix the notion in a concept, and I
called the concept policy classes. Later I realized they were called
mixins by others, but the harm had been done: I didn't know of that
work in time.

2. I had't seen any cool use of policy classes. I mean it. All I saw
were Employee examples and the such. I felt there is a lot of juice
in the idea, juice that has been seen by many but not fully squeezed

And here comes my paper for XP2000, quoted here. My context was:

* I knew the C++ community knew you can collect decisions in classes
and pass them as template arguments.
* I knew people used such things in their designs.
* Yet I didn't know of ANY author who had used policies in an
organized manner to build things like I wanted to build. So basically
I didn't know to whom to give credit. (Later I found out
about "Implementing Layered Designs with Mixin Layers" by Yannis
Smaragdakis and Don Batory.)
* I needed to present the concept to a non-C++ community (mostly Java
and Smalltalk fans) and so I tended to present concepts that were
pretty well-known as new and cool.

And so I wrote the paper as it stands today.

> 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.

I fully agree, and I hope not to be seen as someone who stole a
valuable achievement of someone else, be that entity the C++
community itself, and presented it as his achievement.

For one thing, I asked Dave Abrahams to change text to present my
paper as an exploration of the concept and not as a new idea.
Comments and opinions are welcome. Thanks.


Boost list run by bdawes at, gregod at, cpdaniel at, john at