Wireframe

Light Event Aggregation

Wireframe allows developers to use convention over configuration approach in event aggregation and message passing.

Wireframe - Light Event Aggregation

There is no need to do explicit subscriptions for handling events.

The following convention is used:
  • Event handler callback methods' name must begin with "Handle" and end with "Event"
  • Event handler callback methods must contain only one parameter

Step 1
Create event handler:
public sealed class ExceptionLogger
{
  public void HandleExceptionEvent(LogExceptionEvent message)
  {
    Trace.WriteLine(message.Value);
  }
}

Step 2
Parse assemblies containing event handlers:
Wire.Initialize(Assembly.GetExecutingAssembly());

Step 3
Initialize event handler instance and register it in message passing system:
ExceptionLogger exceptionLogger = new ExceptionLogger().Register();

Step 4
Send event messages to handlers:
try
{
  ...
}
catch (Exception e)
{
  this.Send(new LogExceptionEvent(e));
}


For more details see sample projects with comments in the project source.

Last edited Aug 20, 2013 at 8:19 PM by timothy_makarov, version 6