Openbravo Issue Tracking System - Retail Modules
View Issue Details
0051291Retail ModulesWeb POSpublic2023-01-05 13:022023-01-05 13:02
AugustoMauch 
Triage Platform Base 
normalmajorhave not tried
newopen 
5
 
 
No
0051291: Improving the granularity of PersistenceChangeListenerManager will have a positive performance impact
We use the PersistenceChangeListenerManager to react to certain changes in the application state. For instance, configurations of ConfigurationSets use it to reevaluate the configurations when a given state model is updated, and UserActions do something similar to reevaluate the executability rules when relevant models are updated.

Right now PersistenceChangeListenerManager allows to subscribe to whole models (Ticket, UI, etc). This can be problematic because most of the times someone gets subscribed to that listener, it is only interested on a slice of the model (for instance many executability rules listen to changes in any UI property when the only relevant one for them is UI.currentWindow).

Improving the granularity of the slice of the state being listened to will have a positive performance impact because fewer executability rules and configurations will be reevaluated when a UI state action is executed (and we are executing those VERY often). The price to pay will be to compare the value of the listened state slices before and after each action is executed. We should compare the new cost with the saved cost, but it is probably worth it.

Proposed API:
- Maintain listening to the whole model when needed: addListenedModels(['Ticket'])
- Add a new more granular listener: addListenedModelProperty(['UI.currentWindow'])
-
No tags attached.
Issue History
2023-01-05 13:02AugustoMauchNew Issue
2023-01-05 13:02AugustoMauchAssigned To => Triage Platform Base
2023-01-05 13:02AugustoMauchTriggers an Emergency Pack => No

There are no notes attached to this issue.