3 ms·
You wouldn't send a business rule from a web page, you'd put it in the domain model on the server. The web page has a UI model, not a domain model.
by lonelappde 7y ago
You wouldn't send a business rule from a web page, you'd put it in the domain model on the server.
The web page has a UI model, not a domain model.
- Spearchucker 7y agoThat's the point. And yet Fowler objects because it violates encapsulation and information hiding, because it requires a service layer and makes a model less expressive.
- extra_rice 7y agoYou can easily serialise a well fleshed out (i.e. non-anemic) object. Does the view layer in this particular example need to know the encapsulated business rule? In my experience, not usually. Otherwise, there's most likely a problem with responsibilities. And when that data comes back from the UI, it's also relatively easy to reconstitute it back to well fleshed out objects.
- Spearchucker 7y agoThis I know. The point isn't how one might do it, or whether it can be done¹. The point is that Fowler has issues with anemic objects, even though there are patterns in distrubuted computing best solved by anemic objects. ¹ Note that reconstitution does not do away with anemic objects - reconstitution does not implement logic in a purely object-oriented way, i.e. the logic does not travel, but the data does.