FreedomSoft - "the future is freedom"
Business Logic - Attribute Modes

Attribute Modes is another one of the advanced concepts within Freedombase. Feel free to skip this page of this tutorial, until such time as you feel you understand the basic principles of Freedombase. At that time, come back to this page, and review Attribute Modes at that time.

Calculations can contain literals, and can refer to attributes. Attributes can be referred to in three different modes; Memory; Local Stored; and Distant Stored. Which mode is used depends on how the attribute is named within the calculation.

Memory Mode - If the calculation uses the attribute name only, for example STATE, then it is referring to the value of that attribute, of the instance currently in memory. This is the mode most often used.

An example of a calculation that we have used, that uses Memory Mode, is UPCASE(STATE).

Local Stored Mode - If the calculation uses the system.class.attribute name, for example DEMO_CUSTOMER_STATE, and the calculation is within the DEMO_CUSTOMER system and class, then it is referencing the value of that attribute currently stored on file. This mode is used less frequently, and is usually only used when checking if a value has changed.

An example of Local Stored mode is IF(STATE=DEMO_CUSTOMER_STATE)THEN('The state is the same')ELSE('The operator has changed or set the state').

Distant Stored Mode - If the calculation uses the system.class.attribute name, for example DEMO_STATE_DESCRIPTION, and the calculation is NOT used within the DEMO_STATE system and class, then it is referencing the values of that attribute in all related instances within the DEMO_STATE class.

In this particular example, there will only be one related instance. If there are multiple related instances, and the attribute values are all numeric, then the value of that attribute from all related instances will be summed together and used. If there are multiple related instances, and any attribute values are non numeric, then the attribute values will be concatenated together and used. This mode is used frequently, normally when there will be one related instance with a non numeric value, or when there will be multiple related instances with numeric values.

An example of this mode is DEMO_INVOICE_OUTSTANDING. (This could be the derivation calculation on a BALANCE attribute on a customer, used to keep the customer balance up to date.)

previousnext
1234567891011121314151617181920212223242526272829303132333435363738394041424344