[Kstars-devel] removing KStars::privatedata class

Jason Harris kstars at 30doradus.org
Tue Jul 26 16:22:58 CEST 2005


HI Heiko,

NIce to hear from you :)

On Tuesday 26 July 2005 02:00, Heiko Evermann wrote:
> The idea is that the main class does not change whenever the internal data
> structure changes. Otherwise adding an internal member forces a recompile
> of the whole application.
>
This is the idea in principle, but privatedata is not being used this way.  
KStars has a large number of member variables, only three of which are stored 
in privatedata.   Also, since KStars::privatedata is declared in kstars.h, it 
cannot prevent any compiling.  Everything that includes "kstars.h" will still 
trigger a recompile if things in privatedata change.

> As a private-data-class only keeps member variables and as it is created
> during the creation of the its object and deleted during the corresponding
> destructor, removing this will probably not simplyfy anything.
>
By 'simplify' I meant 'make the code easier to follow'.

So maybe the right solution is to move *all* KStars member data into 
privatedata, and furthermore, to declare privatedata in its own .h file.  
Although, I still think this comes at some cost in code readability, and I'm 
not sure the benefit outweighs.  

Actually, it seems like we have two classes whose job is to store KStars data, 
but neither do it quite properly.  What do people think about merging 
privatedata into KStarsData, and making KStarsData into KStars::Data ?  This 
would actually be a lot of work...we now define basically everything as a 
"friend" of KStarsData so that its members are visible.  All that would have 
to be ripped out (and probably should be).  

Comments?

Jason

-- 
KStars: KDE Planetarium
http://edu.kde.org/kstars


More information about the Kstars-devel mailing list