|
Boost : |
From: Pietrobon Marcello (teiffel_at_[hidden])
Date: 2003-08-08 19:45:03
Hi,
I read today all this thread because this subject is very interesting.
I know I am coming very late so I don't want to re-ignite the discussion again
Just to put a word
I have some doubts about the TraitsImpl approach, as opposed to the pImpl
approach.
On one side the use of template can give you more flexibility.
On an other side less.
IMO it will depend on what you what to do with them.
The use of templates is a very good tool for create flexible components, building
blocks of a program, and integrating them
in your program.
But to put all of them(components) together in the form of some template of
template of ... of template...
that I think it will be too much and you'll end up by loosing flexibility and
giving to the final users
a big headache.
Similarly, because you are working for Boost you are going to probably set a
programming paradigm for the GUI programming
in C++ as the STL has successfully become for data structures and other
algorithms.
Even MFC has somehow done that. And you know with what results.
At the beginning it was seeming to be a good framework. But now, at least by
experience, we know that it is better not to use it
unless for creating very 'standard' programs.
In other words, the choice of putting everything in terms of TraitsImpl and of
always avoiding the pImpl approach
risks to force people to do GUI programming in a way that is going to give people
more trouble than it is worth it.
Perhaps this can be decided only after you'll make your efforts in your new
project.
For me the whole template thing boils down to this: template are great for compile
time components.
I.e. I have a list that I *know* at compile is going to be a list of double.
It will not change dynamically into a list of std::string at runtime.
However, much of UI programming/frameworks is about dynamic changes at *runtime*
NOT compile time.
That's why I am more convinced of the pImpl approach
Also, IMHO, I would keep in mind that programmers successfully use the templates
only after some experience with a more common programming.
I wouldn't start to set up a standard keeping an eye only to 'real' programmers
and scare all the others away.
Which are the vast majority.
I felt I had to express my opinion even if I come very late in the discussion
Maybe it will help.
About the boos_gui and boos_gui_test projects, they do not link under vc6 sp5
( And if I use STLport the not even link, not with vc7.0 either )
It would have been useful to have them working in order to better understand your
concepts.
Best Regards,
Marcello
"E. Gladyshev" wrote:
> --- Douglas Gregor <gregod_at_[hidden]> wrote:
> > > template < typename IT, typename PhysicalGuiLayer
> > >
> > > class ListControl
>
> I came with a name for this idiom, ImplTraits idiom.
>
> template <... typename ImplTraits >
> class someclass
>
> It is like the name of the pImpl idiom.
>
> Eugene
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk