Events

The Persistence Infrastructure provides some helper classes which allow you to raise and listen for events. You can define your own events or write listeners for ones that are already defined "out-of-the-box".

Events can be a useful tool in removing an explicit dependency from one class (the event raiser) to another (the event listener). If you require to add another listener to an event, you can do so without having to "open up" the code that raises the event - the event raiser and listener only depend on the event interface, not on each other's implementation.

The Persistence Infrastructure supports:
To implement events and listeners, follow these steps (described in detail below):

After these steps there is a description of how to add a listener for generic persistence events.