Advanced programming


"Local" properties are properties that are not automatically distributed in the network when the value of the property changes.

Local properties are basically normal .NET properties (getter and setter methods). They are needed when the class is mostly only needed in the local memory space (.NET application domains) and no permanent network access to its properties is necessary. For example, these would be business objects (derivatives of ACBSO).

However, if the class is instantiated in the application tree, the value can still be read and written from a client (which has this instance as a proxy component) over the network. Accessing the ValueT property or alternatively an ACUrlCommand call always means that a WCF call is made immediately on the server side (synchronously).

With "network capable" properties, on the other hand, communication takes places asynchronous, so that the communication layer is not unnecessarily blocked.

Therefore, if you program classes that are instantiated in application trees on the server side, you should only choose "local" properties if the property is rarely needed.


ACPropertyInfo-Attribute class

Use the ACPropertyInfo attribute class described in the previous chapter to announce the local property of the iPlus runtime.

 

Calling on OnPropertyChanged()

Local properties are programmed like normal .NET properties. However, you should call the OnPropertyChanged() method in the Setter methods to trigger the PropertyChanged event of the INotifyPropertyChanged Interface. If you do not do this, but have declared the property as persistent, no persistence will be performed if the instance is in a project application tree! In addition, the Data Binding Overview is not updated in the GUI.

 

Example:

 


The following example shows how to work with local properties.

  • The program lines 1-6 assume that you are inside the class where the property "RunScheduler" is defined (this).
  • Program lines 7 are assumed to be in a different instance, but in the same application domain.
  • For program lines 8, it is assumed that you are in a different application domain or on a different computer and that the "RunScheduler" property is accessed via the network.

 

Persistence behavior

In the example above a property "RunScheduler" was defined. The first parameter of the ACPropertyInfo constructor specifies that the value of the property is to be persisted in the database. This means that after calling the setter method (by calling the OnPropertyChanged() method), the value is automatically stored. If this instance is created again at the next startup, the iPlus framework automatically calls the setter method once with the value that was last stored in the database.

Read more in the chapter Persistence.