Re: DDD Could Have Saved The Day

"Jose Fernandez [email protected] [domaindrivendesign]" <[email protected]> Wed, 15 Jul 2015 09:22:16 -0400
Newsgroups gmane.comp.programming.domain-driven-design
Message-ID <[email protected]>
Yes, factories should ensure that the object is in perfect "shape" at the time of creation. But what I think is the real game changer is the encapsulation part of the domain object. The most common mistake with conventional CRUD is that you have all these public setters that are an invitation to disaster. 

If you ensure encapsulation, you're in good shape. 

Sent from my iPhone

> On Jul 15, 2015, at 12:54 AM, Raoul Duke [email protected] [domaindrivendesign] <[email protected]> wrote:
> 
> > Never create an entity in an inconsistent state. By adhering to this, it becomes syntactically impossible to encounter an invalid entity.
> 
> While DDD might be great, is this not a basic good rule of thumb for
> any 'constructor'?!
>