Open simkimsia opened 4 years ago
I'll give it a read and give my opinion. From a brief glance I can't see what more it provides than a Django model, but it does provide a way to make a typed object nicely.
Thanks. I have a related follow up question.
Which is that how do you handle certain "types" or "status"? Do you store them in database as standalone tables? I posed a similar question to the cosmicpython team as well at https://github.com/cosmicpython/book/issues/288
But I want to hear your thoughts as you're more familiar with Django whereas they're more familiar with Flask.
An example
let's say you have a Batch
Django model, needs to have an attribute of string type called state with the following values: fulfilled
, partial
, unfulfilled
, cancelled
as the only possibilities. Do you have the state as its own individual data table and therefore Django model? If so, do you use the primary key inside Batch table or simply the value itself?
What happens if two entities (in the DDD sense) share the same state field?
Thank you. Looking forward to your reply :)
Awesome style guide by the way 🙏 I think it's great especially the part abt the philosophy on how Django should focus on being a great REST or GraphQL server. That's what attracted me to your styleguide. i.e. the two big problems in the intro. https://github.com/phalt/django-api-domains#introduction
Hi there, i like what you're trying to do with modernising django to use DDD
There's another DDD related book called cosmic python whose authors recommend this DDD pattern called value object
They use python 3.7 dataclass and froze it.
Was wondering if you will cover on how to use value object in Django context. (At least >= Django 2.2)
Here's the relevant line https://github.com/cosmicpython/book/blob/3008a8a4be52e8dcaf5cb7447dd7f2b26f5d9b7d/chapter_01_domain_model.asciidoc#dataclasses-are-great-for-value-objects