From: Fernando Cacciola (fernando_cacciola_at_[hidden])
Date: 2003-08-04 07:48:35
> Aleksey Gurtovoy <agurtovoy_at_[hidden]> wrote in message
> Fernando Cacciola wrote:
> > "Aleksey Gurtovoy" <agurtovoy_at_[hidden]> escribió en el mensaje
> > > David Abrahams wrote:
> > > > Here's an example I just cooked up of using the PP lib to solve a
> > > > classic C++ OO problem: repeated boilerplate in the definition of
> > > > Pimpl classes.
> > >
> > > There is another variation of the idiom, sometimes called "hidden
> > > which doesn't have the shortcoming in the first place:
> > >
> > A shortcoming of the hidden state idiom compared to the classic delegation
> > idiom is that only the state is encapsulated, not the behaviour.
> I am not sure what do you mean by "encapsulated". Hidden in a source file as
> opposite to the header?
Hidden in any other file different from the file containing the
declaration of the public interface.
> > IOWs, if you need to hide the operations, not just the state, you still
> > need to mirror the interface class member functions into
> > the impl class.
> How so? With the hidden state, what would be private member functions
> becomes free functions at the file scope.
Ah... you didn't show this in your example... what you're right AFAICT.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk