> Just curious: is this what FLTK3 is doing..?
> http://www.gamedev.net/page/resources/_/technical/general-programming/the-c-pimpl-r1794
>
> I haven't touched FLTK3 yet, and haven't taken the time to figure it out,
> but just wondering if that's the "trick.."

I came across this technique when I used to follow comp.object and
read Herb Sutter's Guru of the Week column in the C/C++ Report. It
was also one of the many techniques used by John Lakos to reduce code
dependencies and therefore compile times in large C++ projects and I
tried to implement it in my code, alongside Robert C. Martin's ideas
in http://c2.com/cgi/wiki?PrinciplesOfObjectOrientedDesign

My experience, with my own small one-man projects, was that it's a
bit of overkill. If you introduce the Pimpl idiom, abstract classes
for the Dependency Inversion Principle, and try to isolate the main
code from the GUI, you end up with a forest of similarly-named classes
spread across 3 or 4 related (sets of) header and source files.

However, if you want to maintain a stable set of interfaces, for a
large code base, especially one released as a library, then I can see
the merit of the Pimpl idiom.

For FLTK, I think it would require a lot of implementation details to
be moved out of the header files...

Cheers
D.
_______________________________________________
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to