Task #2767

Mis à jour par Sebastien Jacquot il y a plus de 5 ans

Dissociation of computing parameters and rendering parameters doesn't work completely. The purpose is to permit to not recompute a chart that needs only to be rendered.

h3. Problem description

* ChartResult extends TXMResult
* ChartResult._compute() calls ChartResult.__compute() (computing) and ChartResult.renderChart() (rendering)
* TXMResult.compute() doesn't call ChartResult._compute() if the TXMResult is not dirty

To fix this a temporary forcing of the dirty state has been implemented many months ago in ChartResult so the ChartResult._compute() is called even if the result has only rendering parameters that have changed.

<pre>
@Override
public void updateDirtyFromHistory() throws Exception {

super.updateDirtyFromHistory();


this.dirty = super.hasParameterChanged();
if (!this.dirty) {
this.dirty = this.hasRenderingParameterChanged(); // FIXME: SJ: temporary but breaks the dirty computing state and rendering computing state management
// problem here is that if the object is not dirty, TXMResult.compute() doesn't call ChartResult._compute() so the rendering is not done
}
}
</pre>

The original design worked when ChartResult redefined TXMResult.compute() but since we now use ChartResult._compute(), it breaks the computing/rendering dissociation.

So the computing of chart is always done, even if only rendering parameters has changed (e.g. changing the plan of CA chart provokes a CA recomputing + rendering).

# it's not optimized as it was expected in original design
# the computing console log is displayed even if only some rendering parameters have changed

h3. Solutions

* get back to the original design, redefining TXMResult.compute() in ChartResult
* add callback in TXMResult as abstract method onComputingDone() (works only for inheritance)
* add listener mechanism in TXMResult as abstract method onComputingDoneListener / ComputingStateListener (works for inheritance but also for triggering UI events/modifications)
* change the inheritance relation between ChartResult and TXMResult (e.g. a CA computable object and a CAFactorialMap renderable object)
* find some other solutions

Retour