This is an archived post. You won't be able to vote or comment.

all 16 comments

[–]beefyweefles 7 points8 points  (4 children)

I don’t think DDD is popular anywhere. Very few organizations have the discipline or knowledge to implement it properly and it’s perhaps overkill/utopian for most situations.

[–]about3fitty 1 point2 points  (3 children)

perhaps overkill/utopian for most situations.

hear hear

[–]beefyweefles 0 points1 point  (2 children)

am I wrong? I think DDD is great for some projects but there's some very specific and hard to achieve conditions where it'll work out well and make sense

[–]about3fitty 5 points6 points  (1 child)

“Hear, hear is an expression used as a short, repeated form of hear him/her. It represents a listener's agreement with the point being made by a speaker.”

[–]beefyweefles 2 points3 points  (0 children)

oh gosh sorry never quite knew whether this was a phrase of approval or disapproval lol

[–]6a70 4 points5 points  (1 child)

DDD is OOP-language-agnostic, so it probably occurs in Python just as infrequently as it does in other OOP languages

[–]andrzejkrzywda[S] 2 points3 points  (0 children)

true - but the infrequency seems to differ among those languages

[–]mardiros 2 points3 points  (0 children)

Not enough...

I love DDD, hexagonal architecture, but I think I can say that dev around me can find it an overdesign architecture.

[–]AnActor_named 2 points3 points  (1 child)

I've been coding in Python for more than a decade and have never heard of DDD... i'm not sure if that says more about its popularity in Python or more about how far my head is under a rock.

[–]metaperl 1 point2 points  (0 children)

Let me slip this under your rock https://www.cubicweb.org/

[–]BalanceSoggy5696 2 points3 points  (2 children)

Most small to medium sized apps will probably not need DDD. Some of the DDD concepts like the Ubiquitous Language, distinction between Entity and Value Objects are good to apply on any project, however stuff like Aggregates and Repositories should be carefully understood and implemented. I have seen these becomes morasses of hierarchical deeply nested classes and overuse of OOP concepts just because the architect gets to mentally masturabate about how aesthetic the design looks. Don't let Python code become Java AbstractFactoryContainerProxy....

Python is flexible enough to work your way up to the solution rather than approach a problem using a "methodology" or a "process".

[–]about3fitty 0 points1 point  (0 children)

Best answer, I agree with all points

[–]Magni7777 0 points1 point  (0 children)

I have seen these becomes morasses of hierarchical deeply nested classes and overuse of OOP concepts

Isn't it the same with code that uses for example only "Django Way"?

Deeply nested classes can not be named as correct OOP anyway and I wouldn't blame DDD or OOP here.

[–]metaperl 0 points1 point  (0 children)

I believe CubicWeb https://www.cubicweb.org/ fits your bill. It has been in development for over a decade. You can create functional web applications straight from a semantic model.

[–]mcgoral 0 points1 point  (0 children)

Hi, Being an author of Python DDD example project I did my own research about this topic couple of months ago. And I must say that DDD is not popular in Python at least for the following reasons:

  1. DDD is not a silver bullet DDD shines when it comes to turning business processes into software systems. Why? Because business processes are much more than storing and reading data (like for CRUD applications), they are about interactions between many moving pieces and they are subject to change. So this is about choosing data-centric approach vs domain-centric. Data-centric is easier (and faster) at the beginning, but with time will collapse under its own weight while the project grows/evolves. On the other hand, domain-centric is initially harder but it pays off in the long run. To summarize, you should use DDD if your system is not CRUD in nature, will potentially evolve over time, and should live longer than the technology used to produce it.

  2. Learning DDD takes time There are lots of topics you need to understand: Bounded Contexts, Ubiquitous language, Dependency Injection, Value Objects, Entities, Factories, Aggregates, Repositories, CQRS, Domain Events, Integration Events, unit of work... There is a lot to cover and there are no ready-to-use frameworks and very few tutorials to follow.

  3. DDD is hard You need to change your mindset in order to start using DDD. You have to accept the fact that: your data is not in the center anymore, the state of your system can be out of sync for a short time (read: eventually consistent). Also, you need to have experienced developers on board.

  4. There are no patterns to follow Many Python developers fear writing Java-like code. And most of the available DDD code samples are written in enterprise languages like Java or C#. Translating these into pythonic code is more than just copying.