Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/thorium/simplecqrs-fsharp

Simple CQRS implemented with F#
https://github.com/thorium/simplecqrs-fsharp

cqrs fsharp

Last synced: 3 months ago
JSON representation

Simple CQRS implemented with F#

Awesome Lists containing this project

README

        

Simple CQRS on F# (F-Sharp) 3.0

Based on Greg Young's CQRS: https://github.com/gregoryyoung/m-r/tree/master/SimpleCQRS

CQRS is Command and Query Responsibility Segregation -pattern.
If you don't know that, use Google or look http://martinfowler.com/bliki/CQRS.html
I have separated command side and query side as different projects.

This is F# solution. Compared to C#:
+ Simpler source code
+ No need for any "InfrastructureCrap"
+ Domain objects doesn't need to have parameter less constructors
+ Interactive-driven development

What you will need to run this:
+ Visual Studio 11 (Beta): http://www.microsoft.com/visualstudio/11/en-us

Optional:
+ Reactive extensions: http://msdn.microsoft.com/en-us/data/gg577609

There are two versions of event storage:
1) Pure F# as EventStorage.fs
- Uses pure .NET Events with F# Observable as event bus
- Uses MailboxProcessor ("agents"/message passing) as event storage
2) F# with Reactive Extensions as EventStorageRx.fs
- Uses reactive framework Subject as event bus
- Uses reactive framework ReplaySubject as event storage
Although technical concept is different, the functionality is identical.

You can run this with F# interactive, directly from files and/or using Script.fsx.

This QuerySide is just in-memory one as in Greg's example.
I suggest using F# Type Providers in QuerySide with real database...