What is the difference between
What constitutes rich modeling in business-domain classes?
"Rich" as used here implies "rich behavior" (as opposed to state).
There is technical behavior and domain behavior. Accessors and mutators are technical; they lack the "why" which defines business interest.
Domain objects represent the "why" and encapsulate the "how". Actually, all objects do that; domain objects do it specifically for business value.
Let's say you, as an employee domain object, have to request a day off of work. You have 2 options:
Model 1 is rich. The "why" (vacation time) encapsulates the "how" (marking the schedule).
Model 2 relegates the manager to a simple property bag and leaks the scheduling abstraction.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With