TechTalk Genome v4.2

Context.LoadObject Event

Raised when any persistent object is populated into this Context while being activated from a DataDomain.

public event ObjectEventHandler LoadObject;

Implements

IContext.LoadObject

Remarks

Signals that the Context has loaded the state of sender its DataDomain. This event allows the handler to perform initial calculations with the object that yields to transient results. The subcriber may modify sender however it will raise a ChangeObject event for the same persistent object before the processing of LoadObject would finish and thus all subscribers would have performed their initialization methods. Since subscribers of the ChangeObject event might not be necessarily aware of the object being in half initialized state this behaviour is not recomended.

Events raised by the Context can be captured from different areas of interest. The developer may choose to capture a certain event originating from a certain Context by subscribing to one of the Context events using the standard .NET event mechanism. This allows for multiple queued event processors and dynamic strategies in handling events. The order in which subscribers are notified is nondeterministic and hence no subscriber should perform operations with side-effects that would affect the execution of other subscribers or that assumes a certain execution order. This way of processing Context events is similar to handling events raised by ADO.NET DataTable.

The developer might optionally choose to process Context events on persistent objects directly. In this case the class implementing persistency should be inherited from the corresponding callback interface. Each callback interface defines one method to implement with a similar signature as the corresponding event delegate. When the Context raises an event for a persistent object it executes the callback method whenever the object implements the appropriate callback interface. This practically ensures that the object is always subscribed to all events of any Context that it is interested in regardless of how the Context itself is configured by the caller.

The Context that raises the event will automatically become the active Context in the calling thread for the duration of the call. This ensures that any unbound proxies used in the event handlers are resolved from the relevant Context. When the events have been successfully processed, the context stack of the calling thread is restored to its previous state.

Requirements

Namespace: TechTalk.Genome

Assembly: TechTalk.Genome (in TechTalk.Genome.dll)

Version: 4.2.11.59

Editions: Professional, Evaluation, Express

See Also

Context Class | TechTalk.Genome Namespace | ILoadCallback | DeleteObject | ChangeObject