...
Use the ClassBuilder.Add.CalculatedProperty(...)
or one of the overloads to create a new calculated property.
See Metadata Delegate Expressions for many examples of creating calculated properties.
Value-
...
This setting applies to all properties (persistent and calculated) but it is especially useful for calculated properties.
An application can indicate when Quino should recalculate the value for a property.
Default
: For persistent properties, the default isCached
; for calculated properties, it'sVolatile
.Cached
: The value is cached on first retrieval. It is only refreshed when the object is reloaded.Volatile
: The value is recalculated on each retrieval.
If an application has calculated properties that are expensive to calculate but whose value doesn't often change, it can change the value-generation frequency to Cached
in order to speed up display in the UI or reports.
A product can put as much logic/work as it needs into a calculated property. In the next case, we use the ValueGenerationFrequency
to cache the value.
...
API
Methode | Beschreibung |
---|---|
| Berechnet einen Wert anhand des Objektes. Die Funktion wird erneut aufgerufen beim Zugriff auf die Eigenschaft. |
| Berechnet den Wert der Property anhand eines Services. |
| Berechnet den Wert direkt über den mitgegebenen Delegate. Die Signatur des Delegate muss als ersten Parameter ein |
Da die Werte bei jedem Zugriff neu berechnet werden sollte die Berechnung keine zu zeitintensiven Operationen anstossen.