Giter Site home page Giter Site logo

aguerot / mixter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from devlyon/mixter

0.0 1.0 0.0 5.21 MB

CQRS and Event Sourcing Koans

Home Page: http://devlyon.fr/mixter

License: MIT License

Shell 9.89% Batchfile 0.07% PowerShell 9.75% HTML 11.18% CSS 69.11%

mixter's Introduction

Mixter

Mixter is a project to discover CQRS/Event sourcing through koans in multiple languages.

At this point the koans have been ported to 5 languages: C#, Java 8, Scala, PHP and Javascript.

Starting

  1. Checkout master branch
  2. Execute ./run script
  3. You will have to make tests pass green, then to go to next test, execute ./next

See few slides on http://devlyon.fr/mixter, it explains the main steps and goals for each.

You can view one solution for each language with a small Web API on branches [lang]-solution.

Feedback is required

Feel free to use issues in this repo to give your feedback, to propose some improvements, to ask for other languages...and even better to submit pull requests.

Explanations of some implementation details

We have done some choices that we consider implementation details, but that can hurt some people. So we try to explain them here.

About events publication mecanism in CQRS/ES, there are two main well known options :

  1. use an AggregateRoot base class that accumulate uncommitted events that are picked by Repository on Save of the aggregate.

  2. use DomainEvents.Raise(event) static call from AggregateRoot protected Apply method

We chose a third way that consists of passing an IEventPublisher (with Publish method) to each aggregate method to raise events. There is no more need to call Repository.Save and it avoids static method call.

We use a DecisionProjection concept to keep track of "transient state" of aggregates.

We thought this "transient state" as a special projection (like Read model ones) to take further decision in the aggregate, that's why we call it DecisionProjection. We kept this class private inside the aggregate.

Commands and command handlers are not shown here for now, for simplicity, it has been left implicit through method of aggregates.

Perhaps something to introduce in further version.

Any questions ?

You can contact us through GitHub or on Twitter : @clem_bouillier, @florentpellet, @jeanhelou, @ouarzy.

Add new languages

If you want to fork with your preferred language, you only need to follow some rules.

The KoanCli script is based on a naming convention in commit message.

  • Failing tests should contain [Test KO]
  • Resolving tests should contain [Test OK]

Currently the KoanCli script isn't dynamic and tests number must be static to know the correspondence between a test and a step. Here number of tests per step:

  • Step 1, delete command: 4 tests
  • Step 2, timeline messages: 1 tests
  • Step 3, subscription aggregate: 4 tests
  • Step 4, aggregates interaction: 4 tests
  • Step 5, command handler: 2 tests

Changelog

V2

  • Create KoanCli: no git knowledge required. You simply call run script to starting, and next to jump at next step. (#3)
  • Remove reply message (#7)
  • Rename publish to quack (#16)
  • Fix several bug specific at languages (#15, #5, #4)
  • Make PHP version work with PHP 7.2 (#36)

V1 (obsolete)

First version, use during a Mix-IT workshop 2015 : http://www.mix-it.fr/session/1041/agilite-par-le-code-grace-a-cqrs-et-eventsourcing

mixter's People

Contributors

crowdhailer avatar devcrafting avatar fpellet avatar jeantil avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.