Boost logo

Boost :

From: Terje Slettebø (tslettebo_at_[hidden])
Date: 2003-02-28 14:47:54


>From: "Joel de Guzman" <djowel_at_[hidden]>

> > manager<widget>
> >
> > Manager of widget. It's kind of implied that what is managed is the
> > resource itself, even though "resource" doesn't say anywhere. This is
> > similar to that you think it's implied that resource<widget> means it
> > manages the resource, even though "manage" doesn't say anywhere.
>
> Look at it this way. Which noun best describes the following:
> 1) You acquire it
> 2) You release it
> 3) You transfer its ownership
>
> A) manager
> B) resource
> C) managed

Resource.

> > "resource_manager" starts to look attractive, again. ;)
>
> Perhaps. But there's a *better* and *shorter* alternative that very well
fits
> the description. We can say: linear_list_of_items_manager<int>, YUCK!
> Instead, we say list<int>. The management *is* implicit!

Right.

> Also, in general, I would say that any name suffixed by "_manager" are
best
> used for classes that manage *many* things simultaneously, NOT JUST ONE.
> Take a window_manager for example. It is something that manages the
operations
> of many windows. In the Macintosh, for example, the resource manager
manages
> "all* the resources in an application.

Right again.

Ok, I agree that resource<> may be a useful name for it, with implied
management, like e.g. std::list<>, as you say.

Anyway, as Dave A points out in another posting, and which was also the
topic of an earlier of mine, the usefulness of the concept in the first
place hasn't been demonstrated.

The reason I jumped in on the naming discussion, is that I thought
managed<>, or rather manager<> could be a possibility, as well. I thought
the same that Dave said, that resource<widget> doesn't really tell me much,
as it seems it's saying the same thing twice; widged is a resource.

Also, as Gennadiy points out, list<> is a list, while resource<> is not a
resource; it's a manager of a resource.

Regards,

Terje


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