Task #2767

Improve the dissociation between computing and rendering

Added by Sebastien Jacquot 5 months ago. Updated 4 months ago.

Status:New Start date:02/10/2020
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:Charts Spent time: -
Target version:TXM 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).

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

Current solution in TXM 0.8.1

  1. the dirty state of TXMResult must not be automatically changed when parameters are changed
  2. the TXMResult._compute is called if the result is marked dirty OR if its parameters are changed
  3. TXMResult.hasParameterchanged() test the COMPUTING parameters
  4. CharResult.hasParameterchanged() test the COMPUTING and RENDERING parameters
  5. 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

Associated revisions

Revision 2694
Added by Sebastien Jacquot 5 months ago

Progresses on: Dissociation between computing and rendering doesn't work anymore (refs #2767)

History

#1 Updated by Sebastien Jacquot 5 months ago

  • Description updated (diff)

#2 Updated by Matthieu Decorde 5 months ago

  • Description updated (diff)
  • Target version changed from TXM 0.8.2 to TXM 0.8.1
  • % Done changed from 0 to 80

#3 Updated by Matthieu Decorde 5 months ago

  • Subject changed from Dissociation between computing and rendering doesn't work anymore to Dissociation between computing and rendering is not totally satisfying
  • Description updated (diff)
  • Target version changed from TXM 0.8.1 to TXM 0.8.2
  • % Done changed from 80 to 0

#4 Updated by Sebastien Jacquot 5 months ago

  • Tracker changed from Bug to Task
  • Subject changed from Dissociation between computing and rendering is not totally satisfying to Improve the dissociation between computing and rendering
  • Description updated (diff)

#5 Updated by Sebastien Jacquot 5 months ago

  • Description updated (diff)

#6 Updated by Sebastien Jacquot 4 months ago

  • Target version changed from TXM 0.8.2 to TXM X.X

Also available in: Atom PDF