Skip to main content

Aggregates composition for domain driven design in Python

Project description

Pycider

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.

Example: How do Process and Decider work together

A Process all about reacting to events and coordinating between Decider's.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycider-0.6.3.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

pycider-0.6.3-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file pycider-0.6.3.tar.gz.

File metadata

  • Download URL: pycider-0.6.3.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.8.0-47-generic

File hashes

Hashes for pycider-0.6.3.tar.gz
Algorithm Hash digest
SHA256 044dc6afb22d233d7592bf373a55cff0d2c001a090ee43f29505176d0c767e44
MD5 b13217570fadd69fd3706770297f4d6f
BLAKE2b-256 bdad3aa07c20cfa8a73e777e03983b7c9332548f14a2c99212c9329622b3ce4f

See more details on using hashes here.

Provenance

File details

Details for the file pycider-0.6.3-py3-none-any.whl.

File metadata

  • Download URL: pycider-0.6.3-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/6.8.0-47-generic

File hashes

Hashes for pycider-0.6.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a92ff692e9a6bc160db91a9f095ad7fa03ae9b3cfe66de7681b6285940877169
MD5 2d2ff2158efd2e8c154896adf2a84291
BLAKE2b-256 211346a539ebb434688d3a8e7ab0af692c4e7dfb4ed4d65a68cd7978a504a4b3

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page