Project Description
MBS redesign and implemnt CAB (Composite UI Application Block), it also integrate Message Bus, Ioc, and UI Plus-in.


MessageBus:Lightweight bus, support concurrent sending and receiving, support pre-filters, message filters, and hooks, it also support such as Erlang's pattern matching
Service Bus: include Registration Service mapping, location-based services such as lightweight service bus, can be easily integrated Spring, Castle, Unity and other IoC containers
UI Framework: include service bus, message bus, asynchronous UI based on the essential of CAB, SCSF, SharpDevelep, OSGI, etc.

A sample of Message Bus:

1. string of message content
var MB = new MessageBus();//create message bus
var unsubscriber = MB.Subscribe<string>((s,e)=>Console.WriteLine(e));//subscribe the string of message content
MB.Publish("hello Message Bus!");//public the string of message content
unsubscriber.Dispose();//un subscribe

2. int type of message
var MB = new MessageBus();//create message bus
var unsubscriber = MB.Subscribe<int>((s,e)=>Console.WriteLine(e));//subscribe int message type
MB.Publish(521);//publish
unsubscriber.Dispose();//unsubscribe

3. User defined Message
public class Person
{
public string Name { get;set;}
public int Age { get;set;}
public bool Sex { get;set;}
}

var MB = new MessageBus();//create message bus
var unsubscriber = MB.Subscribe<Person>((s,e)=>Console.WriteLine(e.Name));// subscribe Persion Message (the output is Persion.Name)
MB.Publish(new Person { Name = "ZhangSan"});//publish Person Message
unsubscriber.Dispose();//unSubscribe

Last edited Sep 27, 2009 at 10:20 AM by qswang, version 6