[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: the little helpers: SomeClassPrivate
From:       Mike Richardson <mike () quaking ! demon ! co ! uk>
Date:       2001-12-18 12:35:39
[Download RAW message or body]

On Tuesday 18 December 2001 10:45 am, Sebastian Trueg wrote:
> I would like to know why in many KDE classes private members are put in a
> private subclass like KListViewPrivate? I think QT does the same...
> Is it done to reduce the size of the headers? Or for a clearer code?

The idea is to keep binary API compatability. Suppose you change a class and 
add a new member "int anotherInt", then you will need to recompile everything 
that uses (directly or indirectly by inheritance) this class. But if you keep 
things like this in a private class, and the "real" class justs keeps a 
pointer, then yoo don't need to recompile everything.

Seems to me its basically a hack to partially get round the problem that C++ 
doen't properly separate a class interface from its implementation.

>
> Maybe I should also do this in my own classes...?
>
> Cheers
> Sebastian
>
> >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
> >> unsubscribe <<

Mike

-- 
mike@quaking.demon.co.uk
http://www.quaking.demon.co.uk
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic