• calcopiritus@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    8 days 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.