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();
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. Current solution in TXM 0.8.1
# the dirty state of TXMResult must not be automatically changed when parameters are changed
# the TXMResult._compute is called if the result is marked dirty OR if its parameters are changed
# TXMResult.hasParameterchanged() test the COMPUTING parameters
# CharResult.hasParameterchanged() test the COMPUTING and RENDERING parameters
# the CharResult._compute methods calls
#* __compute & renderChar if the result is marked dirty
#* __compute & renderChar the COMPUTING parameters changed
#* renderChar the RENDERING parameters 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 (don't mix TXMResult computing with a chart rendering. e.g. a CA computable object and a CAFactorialMap renderable object or as it's already done for the Specificities and the SpecificitiesSelection chart)
* find some other solutions
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();
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. Current solution in TXM 0.8.1
# the dirty state of TXMResult must not be automatically changed when parameters are changed
# the TXMResult._compute is called if the result is marked dirty OR if its parameters are changed
# TXMResult.hasParameterchanged() test the COMPUTING parameters
# CharResult.hasParameterchanged() test the COMPUTING and RENDERING parameters
# the CharResult._compute methods calls
#* __compute & renderChar if the result is marked dirty
#* __compute & renderChar the COMPUTING parameters changed
#* renderChar the RENDERING parameters 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 (don't mix TXMResult computing with a chart rendering. e.g. a CA computable object and a CAFactorialMap renderable object or as it's already done for the Specificities and the SpecificitiesSelection chart)
* find some other solutions