DDD + Public Constructors Constructors - Should They Exist?

One of the DDD tenants is to prevent your property from entering an invalid state. For me, this means that there should not be an open constructor without parameters, because it will be an object in an invalid state in 99% of cases.

Is this a good way to move forward? This becomes a huge PITA when you just want to quickly create a new class.

+5
source share
3 answers
Good question. I have friends of DDD nazi who say that uncompromising designers are the devil. I agree to some extent, but I also feel that it depends on the purpose of the class.
+2

, , . ? , , - , , . , - .

. PITA , , , , , . - , .

+2

, . , , factory " ", - .

0
source

All Articles