Objects should be constructed in one go
Link – – matthiasnoback.nl
In another cool blogpost, Matthias Noback explains a few best practices around newing up objects, illustrated with some great examples.
Consider the following rule: "When you create an object, it should be complete, consistent and valid in one go." It is derived from the more general principle that it should not be possible for an object to exist in an inconsistent state. I think this is a very important rule, one that will gradually lead everyone from the swamps of those dreaded "anemic" domain models. However, the question still remains: what does all of this mean?
Read more [matthiasnoback.nl]
What are your thoughts on "Objects should be constructed in one go"?