Re: Re: Populating new aggregates
"Caleb Cushing [email protected] [domaindrivendesign]" <[email protected]> Fri, 04 Sep 2015 12:36:31 +0000
| Newsgroups | gmane.comp.programming.domain-driven-design |
|---|---|
| Message-ID | <CAAHKNRH+zHh_5HxToa_2mFUNRhVfkzxhi2+rubETsyzowm8rtQ@mail.gmail.com> |
oh, and as sort of a 3rd case, your framework may require you to allow creation of your object in an inconsistent state. Some patterns may also require/allow it for sake of code readability. Example, Hibernate requires that entities have a no args constructor. It is common to use setters then to fill out the object. If you have more than a handful of properties you wouldn't want to pass them in one method anyways, that would be unreadable. There are alternatives like a Builder or Options objects, but they could be overkill. -- Caleb Cushing http://xenoterracide.com