Task #2767
Improve the dissociation between computing and rendering
Statut: | New | Début: | 10/02/2020 | |
---|---|---|---|---|
Priorité: | Normal | Echéance: | ||
Assigné à: | - | % réalisé: | 0% |
|
Catégorie: | Charts | Temps passé: | - | |
Version cible: | TXM 0.X.X |
Description
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.
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.
@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 } }
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
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
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
Révisions associées
Progresses on: Dissociation between computing and rendering doesn't work anymore (refs #2767)
Historique
#1 Mis à jour par Sebastien Jacquot il y a plus de 5 ans
- Description mis à jour (diff)
#2 Mis à jour par Matthieu Decorde il y a plus de 5 ans
- Description mis à jour (diff)
- Version cible changé de TXM 0.8.2 à TXM 0.8.1
- % réalisé changé de 0 à 80
#3 Mis à jour par Matthieu Decorde il y a plus de 5 ans
- Sujet changé de Dissociation between computing and rendering doesn't work anymore à Dissociation between computing and rendering is not totally satisfying
- Description mis à jour (diff)
- Version cible changé de TXM 0.8.1 à TXM 0.8.2
- % réalisé changé de 80 à 0
#4 Mis à jour par Sebastien Jacquot il y a plus de 5 ans
- Tracker changé de Bug à Task
- Sujet changé de Dissociation between computing and rendering is not totally satisfying à Improve the dissociation between computing and rendering
- Description mis à jour (diff)
#5 Mis à jour par Sebastien Jacquot il y a plus de 5 ans
- Description mis à jour (diff)
#6 Mis à jour par Sebastien Jacquot il y a plus de 5 ans
- Version cible changé de TXM 0.8.2 à TXM 0.X.X