One of the classic OOP principles is the ‘always-valid domain entity’. The idea is that entities and value objects don’t need to be validated, as invalid construction is actively guarded against.
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.
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.