Need help with ShortBus?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

mhinze
204 Stars 42 Forks MIT License 58 Commits 14 Opened issues

Description

In-process mediator with low-friction API

Services available

!
?

Need anything else?

Contributors list

# 348,437
C#
Shell
39 commits
# 179,926
jira
c-sharp
.NET
nunit
5 commits
# 183,569
Shell
c-sharp
convent...
.NET
1 commit
# 110,799
mpvue
wxmp
Vue.js
excel
1 commit
# 12,074
C#
Git
Azure
Visual ...
1 commit
# 564,536
C#
Shell
1 commit
# 665,223
C#
Shell
1 commit
# 518,565
Webpack
azure-f...
C#
F#
1 commit

ShortBus

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

Command

public class DoSomething : ICommand { }

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

_mediator.Send(new DoSomething());

Query

public class AskAQuestion : IQuery { }

public class Answerer : IQueryHandler { 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();
    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.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.