
Gennadiy Rozental wrote:
Hi,
I'm trying to pick good names for the fundamental iostreams components streambuf_facade and stream_facade:
template<typename Device ... > class streambuf_facade : public basic_streambuf< > { // Peform i/o using an instance of Device };
template<typename Device ... > class stream_facade : public basic_[i][o]stream< > { // Peform i/o using an instance of Device };
Here are the candidates:
1. streambuf_facade / stream_facade
If this components indeed follow Facade pattern this would be my choice of name.
Thanks. Strictly speaking it's a facade, but it would probably be better characterized as an adapter. I don't like streambuf_adapter, however, because it's not clear from the name whether the adapter produces a streambuf or turns a streambuf into something else. I think what makes me most reluctant to use "facade" or "adapter" in this case is that the classes being turned into streambufs are typically designed for the sole purpose of being adapted in this way. I usually think of facades or adapters as proving a new interface for some useful pre-existing facility.
Gennadiy
Jonathan