713 reputation
811
bio website
location
age
visits member for 3 years, 4 months
seen Jun 2 at 12:47

Aug
3
awarded  Popular Question
Aug
1
awarded  Yearling
Apr
11
awarded  Good Question
Apr
9
awarded  Favorite Question
Apr
7
comment Zero behavior objects in OOP - my design dilemma
I like your blog.
Apr
7
accepted Zero behavior objects in OOP - my design dilemma
Apr
4
awarded  Notable Question
Apr
3
awarded  Good Question
Apr
3
comment Zero behavior objects in OOP - my design dilemma
Perhaps I provided a poor example, which you focused on in particular. The question is more general. Yes in card games, rule objects will dictate available actions and they contain the domain logic. However for any problem domain in existence I can implement things as a combination of controller (domain rules) objects and data objects (with no functionality). This makes separation of concerns and encapsulation easier to achieve, which is why I've been doing this. The reason I asked this question is because I got concerned I was separating data and logic too far.
Apr
3
awarded  Popular Question
Apr
2
awarded  Yearling
Apr
2
awarded  Nice Question
Apr
2
comment Zero behavior objects in OOP - my design dilemma
Well there's nothing wrong with a static function, but if I start doing this frequently I'll wind up with a bunch of struct-like classes and static functions (like global functions in other langages). At that point it stops being OOP and starts being functional or procedural programming.
Apr
2
comment Zero behavior objects in OOP - my design dilemma
Plain-Old-Data objects are a perfectly valid pattern I didn't say they weren't, I'm saying it's wrong when they populate the entire lower half of the application.
Apr
2
comment Zero behavior objects in OOP - my design dilemma
It is, because data and behaviour are completely and entirely separated. I might as well be using structs and global functions.
Apr
2
revised Zero behavior objects in OOP - my design dilemma
added 755 characters in body
Apr
2
asked Zero behavior objects in OOP - my design dilemma
Jan
10
comment Should I use Dependency Injection or static factories?
I avoid DI through setters because it introduces a window of time during which the object is not in fully initialized state (between constructor and setter call). Or in other words it introduces a method call order (must call X before Y) which I avoid if at all possible.
Dec
23
awarded  Notable Question
Mar
16
awarded  Popular Question