no comments (yet)

sorted by: hot top controversial new old
there doesn't seem to be anything here
1 comment in c/programming@programming.dev view that post
[–] 2 points 4 months ago

TL;DR:

Domain Driven Design has a flaw: not all types can be categorized into "valid" and "invalid", since it often depends on context.

Solution: you just haven't modeled your domain correctly. You have a type for "MyData" but you don't have a type for "MyDataThatIsBeingEditedByTheUser".

So the "final" type should be valid, but often you should have intermediate type(s) that model incomplete input.

Basically, when doing DDD don't forget your builder types.

  • source