@davetron5000 I think generically it's better for the class to return a value rather than own the value as state, but I've written the "own the value" enough times that I clearly don't think it's that much of a win in practice.

1
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin
Noel Rappin

@davetron5000 The second version is something that I sometimes call “syntactic" OO -- it's a very generic pattern that works in almost any domain, so if you are a consultant going from project to project, it's a very easy way to get a plausible system design quickly. (I guess that's true of both of these, but the custom result object makes me think there's more domain design going on in the first case)

0
6mo
Replies