Skip to content

melodyasper/pycider

Repository files navigation

Pycider

Documentation StatusTest Status

Documentation is here. This code is a Python implementation of deciders based on the F# code from Jérémie Chassaing located here dddeu-2023-deciders. There was additionally a talk on this, to be found here.

Installation

You can use pip install pycider or poetry add pycider to install this project from PyPI.

Usage

You can create Process or a Decider. A simple example of this can be found under the test composition page.

Decider

Decider is a simple state machine that seperates state changes and actions. Commands are actions which when executed return Events representing the results from the actions. You can use Event's to deterministically update the State allowing replayability and easy serialization by only saving Event's.

  • Commands are turned into Event's through decide() calls.
  • Event's deterministically update the State through evolve() calls.

Process

Process is a simple state machine for managing a system. A system has several needs. The system given a State should be able to resume to the next Command, The system should be able to react to Event changes and return Command's for dealing with those changes. Finally the system should be able to update the State deterministically given a Event.

  • Event's are turned into Commands thrugh react() calls.
  • Given a State, the system should be able to resume() to the appropriate Command.
  • Event's deterministically update the State through evolve() calls.

About

Aggregate Composition for Python. A domain driven design architecture.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages