In-process mediator with low-friction API
C# Shell
Latest commit f0bb38e Nov 12, 2014 @mhinze Merge pull request #39 from jrnail23/master
Updated Autofac integration to latest Autofac version
Permalink
Failed to load latest commit information.
.nuget trying to fix 'The underlying connection was closed: Could not establ… Jul 22, 2013
Build shortbus.markers nuspec May 11, 2012
ShortBus.Autofac Updated Autofac to latest (from v3.1.5 to v3.5.2) Nov 11, 2014
ShortBus.Markers Reorienting ShortBus to mediation semantics Jan 16, 2014
ShortBus.Ninject Reorienting ShortBus to mediation semantics Jan 16, 2014
ShortBus.SimpleInjector Add SimpleInjector to supported Containers Jun 26, 2014
ShortBus.StructureMap Reorienting ShortBus to mediation semantics Jan 16, 2014
ShortBus.Tests Updated Autofac to latest (from v3.1.5 to v3.5.2) Nov 11, 2014
ShortBus.Unity Reorienting ShortBus to mediation semantics Jan 16, 2014
ShortBus.Windsor Reorienting ShortBus to mediation semantics Jan 16, 2014
ShortBus Reorienting ShortBus to mediation semantics Jan 16, 2014
Tools/nunit add build script Feb 28, 2012
.gitignore Ignore additional NCrunch files Nov 11, 2014
LICENSE.md update nuspecs (to reflect community contribution), readme (to reflec… Nov 26, 2013
README.md Add SimpleInjector to supported Containers Jun 26, 2014
ShortBus.Autofac.nuspec nuspec cleanup, typo fix, new logo Dec 17, 2013
ShortBus.Markers.nuspec nuspec cleanup, typo fix, new logo Dec 17, 2013
ShortBus.Ninject.nuspec nuspec cleanup, typo fix, new logo Dec 17, 2013
ShortBus.SimpleInjector.nuspec Add SimpleInjector to supported Containers Jun 26, 2014
ShortBus.StructureMap.nuspec nuspec cleanup, typo fix, new logo Dec 17, 2013
ShortBus.Unity.nuspec nuspec cleanup, typo fix, new logo Dec 17, 2013
ShortBus.Windsor.nuspec nuspec cleanup, typo fix, new logo Dec 17, 2013
ShortBus.nuspec nuspec cleanup, typo fix, new logo Dec 17, 2013
ShortBus.sln Add SimpleInjector to supported Containers Jun 26, 2014
ShortBus.sln.DotSettings initial commit Feb 28, 2012
build.cmd add build script Feb 28, 2012
sb.png nuspec cleanup, typo fix, new logo Dec 17, 2013

README.md

ShortBus

ShortBus is an in-process mediator with low-friction API

Command

public class DoSomething : ICommand { }

public class DoesSomething : ICommandHandler<DoSomething> {
    public void Handle(DoSomething command) {
       // does something
    }
}

_mediator.Send(new DoSomething());

Query

public class AskAQuestion : IQuery<Answer> { }

public class Answerer : IQueryHandler<AskAQuestion, Answer> {
    public Answer Handle(AskAQuestion query) {          
        return answer;
    }
}

var answer = _mediator.Request(new AskAQuestion());

IOC Containers

ShortBus currently supports 6 IOC containers

  • AutoFac
  • Ninject
  • Simple Injector
  • Structure Map
  • Unity
  • Windsor

Example configuration of registering handlers using StructureMap:

ObjectFactory.Initialize(i => i.Scan(s =>
{
    s.AssemblyContainingType<IMediator>();
    s.TheCallingAssembly();
    s.WithDefaultConventions();
    s.AddAllTypesOf(typeof (IQueryHandler<,>));
    s.AddAllTypesOf(typeof (ICommandHandler<>));
}));    

Low-friction API

No type parameter noise.

What for?

  • Query objects
  • Enables subcutaneous testing
  • Business concepts as first class citizens

In Production

ShortBus is in production powering the server APIs for major ecommerce applications.