Skip to content

abeaufays/ddd_example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

In this repo, we try to implement in python several example from the DDD book from Eric Evans.

Layer example

The first example is found in the chapter 4: Isolating the domain, that talks about layers.

Sequence Diagram representing transfer of fund between two accounts

It involves layering, repositories and unit of work.

We are using Django as the infrastructure implementation.

General example

The second example comes from Chapter 7: Using the Language: An Extended Example.

It describes a system that will handle cargo shipping, the general model looks like this:

Class diagram of the cargo shipping domain

Comments

About injecting Unit of work into domain functions

On one hand, it make sense to consider "making a persisting change to the model" as a domain concept, but on another hand "polluting" the domain layer with a UnitOfWork parameter feels clunky ?

We could also see it as marking a function as "mutable for the domain" where others would by default not have any side effect.

Maybe something can be done with a decorator to inject the UnitOfWork in a more "pythonic" way ?

About

This repo is used to discuss ddd concept in the context of a Django app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages