Boost logo

Boost :

From: williamkempf_at_[hidden]
Date: 2001-08-07 09:54:19


--- In boost_at_y..., "Ed Brey" <edbrey_at_y...> wrote:
> From: "Douglas Gregor" <gregod_at_c...>
>
> > > problem of the obfuscation that the hand-coded extra class
causes:
> it
> > > appears that there is a an is-implemented-in-terms-of relation,
> which
> > > isn't really the intent. Base_from_member makes the intent
clear,
> which
> > > is just to work around an initialization ordering limitation.
> >
> > If a generic class can be named to make the intent clear, so can a
> hand-coded
> > one. The hand-coded version also has several advantages:
> > - The fact that the idiom is used at all is confined to the base
class
> list
> > and the constructors
>
> Good point. The naming advantage is small. There is still utility
in
> having a standard name, so a reader unfamiliar with the pattern can
> cross-reference the name and look up pre-written documentation on
what
> is being accomplished. There is no easy way to accomplish this
with a
> hand-coded class. I consider this a small advantage only. And on
the
> other hand, since this situation is somewhat rare, an advanced
reader
> may not be familiar with the boost class, and looking it up may take
> longer than figuring out the hand-written code.

This is a design pattern, and as such the pattern should have a name,
but there's no reason a base class (or other reusable framework) need
exist for the pattern. Everyone knows what a singleton is (and we
can look up all the details of the pattern), for instance, but most
of us would agree that it's problematic and not worth the effort to
create a base class for this pattern. I'm not sure that the "Base
from Member" falls in the same category as singleton... it may be
worth having a reusable framework for implementing this. I'm just
pointing out that Patterns already deal with the whole discussion
above and may be all that's wanted here. In other words, instead of
a base class, maybe all that you need is for Boost to start housing
peer reviewed pattern descriptions.

Bill Kempf


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