[Kstars-devel] RFC: Redesing of KStars
Thomas Kabelmann
thomas.kabelmann at gmx.de
Sat Jul 30 13:17:17 CEST 2005
Hi all,
while trying to refactor the skymap I gave up because there is a bad design in
kstars and it would be nonsense to refactor it that way. Currently we hold
all data in KStarsData and for each data element we have a init/load method.
The same problem is in the skymap. We have for each drawable object a draw
method. So these 2 classes are blown up and unmaintainable.
My idea is now to rip off all code belonging to drawable objects from
KStarsData and SkyMap and create new classes for drawable objects. So we need
a sane interface for drawable objects. The API should look like the
following:
class KStarsElement
{
public:
void init() // init data
void load() // load data from file
void draw() // draw data to skymap
void update() // update data
}
Element classes will be for example:
- solar system
- deep sky objects
- horizon
- ecliptic
- constellation lines
...
These KStarsElements will be managed in KStarsData. So KStarsData can init,
load and update them at once, the skymap can draw them at once. Another
advantage is, that the element class doesn't need include the KStarsData
class and KStarsData doesn't need that much friend class clauses.
Since this is a big job, I would hear your opinion about the idea and how we
could realize it. Should we open a new branch, or should this work done in
KDE4 branch?
Regards,
Thomas
More information about the Kstars-devel
mailing list