Initialize Attributes is a step in the Segment Cycle, Ispec Cycle, Copy Cycle, and Messenger Cycle, in which attributes are initialized. The following is a list of attributes that are initialized:
All attributes that are members of the current cycle element, example Ispec, CopyIspec, Messenger, that do not have an initial value defined in the Value property.
For attributes that are members of the Segment
All primitive attributes that do not have an initial value defined in the Value property.
All Group attributes
Note that the attributes with an initial value defined in the Value property and non-primitive class attributes owned by the Segment, are not initialized during the runtime cycle. Any new value moved into these attributes during a transaction will remain in that specific instance. The runtime environment maintains a pool of these runtime objects for use by all the users, and these are assigned to the individual transactions on a random basis. For example, if you move a value into one of these attributes in one transaction, and then perform another transaction a few seconds later that inspects that attribute, you are likely to see a different value because internally it could be using a different physical version of that object from the pool. Hence, you cannot depend upon a new value moved into one of these attributes in one transaction being preserved and available for a future transaction by the same user.
If your logic is sensitive to the internal state of such objects, then you should initialize them yourself. For example, you can use the Initialize() method to set the attributes to spaces or zeros and to reset the initial value attributes to the value defined in the Value property.
Furthermore, note that the attributes that are members of the Segment and have the IsPersistent property set to Yes are not initialized by the runtime cycle, but instead have their value preserved from transaction to transaction throughout a user session (See Session Data for more information).
On the Windows platform, a performance optimization property is available for models that have a large number of primitive and Group attributes owned by the Segment. This is a configuration property on the Segment named Generate Optimized Initialization Code. This results in the code being generated for each ispec to initialize only those primitive and Group attributes in the Segment that are actually used by the ispec (or by any logic called by the ispec). For models with a very large number of such attributes, this can reduce the overhead of cycle initialization. Generating the optimized code takes extra work by the builder. Therefore, using this option is a trade-off between the time taken to build the system and the performance of the runtime system.