Bug #2685

Mis à jour par Sebastien Jacquot il y a presque 6 ans

Currently TXMResult children are automatically computed when the TXMResult is computed.

This simplifies simply the usage of the TXMResult BUT partially breaks broke the lazy loading feature since all children are computed with the TXMResult.
Eg. computing a sub result of a partition will compute all its parent up to the Partition. Then the Partition will compute all its children therefore all the children results.


Some TXMResults Problem : some TXMResult need their children to be computed at the same time.
1) to beeing consistent and usable :
- eg.
eg
*
the Partition and its Parts.
2) to maintain a coherent state between in a results branch
- eg. Lexical Table => CA => AHC
3) for UI viewing
- eg.
* the Editor of the CA that needs to display the Eigenvalues bar chart child

h3. Solution 1

WIP:

Piste d'améliorations du lazy :
- on pourrait avoir un lazy plus fin lors du recalcul des enfants d'un parent en ne recalculant que les enfants qui ont déjà été ouverts (computés au moins une fois, hasBeenComputedOnce()), ne les passer en dirty depuis le compute du parent que si Children.hasBeenComputedOnce()
- on pourrait ne jamais recalculé les enfants d'un résultat et mettre à jours dès qu'on souhaite le manipuler (ouverture d'un éditeur, recalcul dans l'éditeur, afficher une fenêtre dans l'éditeur "le résultat doit être recalculé etc."

Piste de résolution de la synchronisation Partition-Parts :
- en amont du test hasBeenComputed() de l'amélioration du lazy, introduire une variable interne de TXMResult : synchronizedWithParent qui est réglée à true pour les Parts

Change the way to manage the dirty state of the children, eg.:
TXMResult.compute()

<pre>
// set the children as dirty since the
and its EigenValues result has changed
for (int i = 0; i < this.children.size(); i++) {
if(child.mustBeSyncWithParent() || child.hasBeenComputedOnce())
this.children.get(i).setDirty();
}
}
</pre>

Retour