All Projects → runemalm → ddd-for-python

runemalm / ddd-for-python

Licence: GPL-3.0 License
A domain-driven design framework for Python.

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to ddd-for-python

ddd-example-ecommerce
Domain-driven design example in Java with Spring framework
Stars: ✭ 73 (+143.33%)
Mutual labels:  ddd, domain-driven-design, hexagonal-architecture
DDD
Domain-Driven Design example
Stars: ✭ 116 (+286.67%)
Mutual labels:  ddd, domain-driven-design, hexagonal-architecture
educational-platform
Modular Monolith Java application with DDD
Stars: ✭ 124 (+313.33%)
Mutual labels:  ddd, domain-driven-design, hexagonal-architecture
teamo-ddd-example
Implementing Domain Driven Design in PHP using Laravel
Stars: ✭ 46 (+53.33%)
Mutual labels:  ddd, domain-driven-design, hexagonal-architecture
Library
This is a project of a library, driven by real business requirements. We use techniques strongly connected with Domain Driven Design, Behavior-Driven Development, Event Storming, User Story Mapping.
Stars: ✭ 2,685 (+8850%)
Mutual labels:  ddd, domain-driven-design, hexagonal-architecture
typescript-ddd-course
🔷🔖 TypeScript DDD Course: Learn Domain-Driven Design in TS lesson by lesson
Stars: ✭ 28 (-6.67%)
Mutual labels:  ddd, domain-driven-design, hexagonal-architecture
typescript-ddd-example
🔷🎯 TypeScript DDD Example: Complete project applying Hexagonal Architecture and Domain-Driven Design patterns
Stars: ✭ 607 (+1923.33%)
Mutual labels:  ddd, domain-driven-design, hexagonal-architecture
Php Ddd Example
🐘🎯 Hexagonal Architecture + DDD + CQRS in PHP using Symfony 5
Stars: ✭ 1,960 (+6433.33%)
Mutual labels:  ddd, domain-driven-design, hexagonal-architecture
repository
[PHP 7] Implementation and definition of a base Repository in Domain land.
Stars: ✭ 26 (-13.33%)
Mutual labels:  ddd, domain-driven-design, hexagonal-architecture
go-hexagonal http api-course
Ejemplos del curso de API HTTP en Go aplicando Arquitectura Hexagonal
Stars: ✭ 78 (+160%)
Mutual labels:  ddd, domain-driven-design, hexagonal-architecture
delta
DDD-centric event-sourcing library for the JVM
Stars: ✭ 15 (-50%)
Mutual labels:  ddd, domain-driven-design
e-shop
Sample Spring Cloud microservices e-shop.
Stars: ✭ 48 (+60%)
Mutual labels:  ddd, domain-driven-design
eventuous
Minimalistic Event Sourcing library for .NET
Stars: ✭ 236 (+686.67%)
Mutual labels:  ddd, domain-driven-design
MonolithicArchitecture
This repository presents an approach on how to build an application using Monolithic architecture, ASP.NET Core, EntityFrameworkCore, Identity Server, CQRS, DDD
Stars: ✭ 18 (-40%)
Mutual labels:  ddd, domain-driven-design
kingdom-python-server
Modular, cohesive, transparent and fast web server template
Stars: ✭ 20 (-33.33%)
Mutual labels:  ddd, hexagonal-architecture
DDD
Domain-Driven Design is a software development approach in which it utilizes concepts and good practices related to object-oriented programming.
Stars: ✭ 51 (+70%)
Mutual labels:  ddd, domain-driven-design
DDDToolbox
A set of Roslyn refactorings supporting DDD design
Stars: ✭ 31 (+3.33%)
Mutual labels:  ddd, domain-driven-design
financial
POC de uma aplicação de domínio financeiro.
Stars: ✭ 62 (+106.67%)
Mutual labels:  domain-driven-design, hexagonal-architecture
Clean-Architecture-Template
Configurable Clean Architecture template containing the DDD + CQRS approach for .NET Core applications.
Stars: ✭ 14 (-53.33%)
Mutual labels:  ddd, domain-driven-design
buchu
Use Cases - Uniform, auditable and secure use case library
Stars: ✭ 23 (-23.33%)
Mutual labels:  ddd, domain-driven-design

ddd-for-python

This is a framework for developing apps based on domain-driven design.

The design is inspired by Vaughn Vernon's reference implementation of DDD in Java.

A little bit of inspiration also comes from django.

Purpose:

The goal of this project is to provide a complete framework for implementing DDD bounded contexts in Python.

Read the user guide in the documentation to get started. You can also look at the example code of the 'shipping' context.

Star and/or follow the project to receive notifications when version 1.0.0 is released.

Design:

The design is based on these patterns:

  • DDD (collection of patterns)
  • Hexagonal Architecture
  • Near-infinite Scalability ("Entity" concept)
  • xUnit (for testing)

Theory:

The following sources are recommended:

Supported Python Versions:

  • Tested with python 3.8.5.
  • Should work with any version >= 3.8.0 (not tested).

Installation:

$ pip install ddd-for-python

Example:

# This is the "main.py" file that
# starts the bounded context in a container.

from ddd.application.config import Config
from ddd.infrastructure.container import Container

from shipping.utils.dep_mgr import DependencyManager
from shipping.application.shipping_application_service import \
    ShippingApplicationService


if __name__ == "__main__":
    """
    This is the container entry point.    
    Creates the application service and runs it in the container.
    """
    
    # Config
    config = Config()

    # Dependency manager
    dep_mgr = \
        DependencyManager(
            config=config,
        )

    # Application service
    service = \
        ShippingApplicationService(
            customer_repository=dep_mgr.get_customer_repository(),
            db_service=dep_mgr.get_db_service(),
            domain_adapter=dep_mgr.get_domain_adapter(),
            domain_publisher=dep_mgr.get_domain_publisher(),
            event_repository=dep_mgr.get_event_repository(),
            interchange_adapter=dep_mgr.get_interchange_adapter(),
            interchange_publisher=dep_mgr.get_interchange_publisher(),
            job_adapter=dep_mgr.get_job_adapter(),
            job_service=dep_mgr.get_job_service(),
            log_service=dep_mgr.get_log_service(),
            scheduler_adapter=dep_mgr.get_scheduler_adapter(),
            shipment_repository=dep_mgr.get_shipment_repository(),
            max_concurrent_actions=config.max_concurrent_actions,
            loop=config.loop.instance,
        )

    # ..register
    dep_mgr.set_service(service)

    # Container
    container = \
        Container(
            app_service=service,
            log_service=dep_mgr.get_log_service(),
        )

    # ..run
    loop = config.loop.instance
    loop.run_until_complete(container.run())
    loop.close()

For the full code, see: "examples/webshop/shipping".

Documentation:

You can find the latest documentation at readthedocs.

Contribution:

If you want to contribute to the code base, create a pull request on the develop branch.

Release Notes:

0.9.5 - 2022-03-13

  • Added documentation.
  • Moved db_service related classes.
  • Moved event related classes.
  • Added MemoryPostgresDbService to be able to run tests against an in-memory postgres database.
  • Fixed bug: container kwarg in example main.py (thanks euri10).

0.9.4 - 2021-05-17

  • Added 'context' to log service's log messages.
  • Moved record filtering methods to base repository class.
  • Added 'uses_service' to Task class. Deprecate 'makes_requests'.

0.9.3 - 2021-03-27

  • Searching env file from cwd by default in tests, (when no path specified).
  • Refactored Task class to make it more simple.
  • Refactored the configuration solution by adding a Config class.
  • Added example code for 'shipping' context of a webshop application.
  • Added get_all_jobs() and get_job_count() to scheduler adapter & service.
  • Added missing call to _migrate() in a couple of Repository class functions.

0.9.2 - 2021-03-15

  • Fixed bug: Env file wasn't loaded in certain circumstances.

0.9.1 - 2021-03-14

  • Initial commit.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].