[Kst] Re: Class changes
C. Barth Netterfield
netterfield at physics.utoronto.ca
Fri Jul 30 03:04:58 CEST 2004
On Thursday 29 July 2004 07:02 pm, you wrote:
> My concern here is that we are sacrificing functionality
> for a "clean" class design. However, the functional specification
> should always preceed any code design and implementation.
> Some desired functionality results in complex code (but this
> is not the same as "dirty" code). I think the fits was a case
> in point. At the cost of an additional class we tied together
> the curves and labels. I think this is something very desirable
> to do and its only a matter of time before we get a complaint
> about not doing it.
I agree that we have reduced functionality in the fits, but I hope it is
For example, the problem where, if we change a fit, it doesn't change the
lable is a problem which is generic to any label associated with a data
object. It is the same problem with auto-generated X and Y labels in plots,
for example. I would like to think about a generic solution to this.
What I am imagining is for KstDataObject is to get a virtual QString
automaticLabel(), which can be implemented by different child classes. For
fits, we could "if (plugin->_isFit) ..." in KstPlugin::automaticLabel().
Then we can refer to a data-object's automaticLabel in any label; changing the
data object will change the label. (Eg, change a vector in a curve, and the
X and YLabels in the plot, if they refer to the autmaticLabel, automatically
change) This could be awsome for equations as well - well formated equation
names could be exported for label use.....
A similar problem is wrst exported scalars - what happens when you change
the source of an automatic scalar, or change the name of a vector which is
generating automatic scalars. This is a general problem which arrises from
our refering to a label by its tagname, and it needs a general solution.
More information about the Kst