News for hackers. Stuff that matters.
Re:Your DI framework is killing your code by efdee on Tuesday September 29, 2015 @08:28AM (#10295753)
I can't help but disagree with so many of the things he says.

I won't even go into things like "Does your customer know what an OrderPriceStrategyFactory is for? No, then it’s not a real thing. Its some bullshit you made up.", but statements like "If we change how we contact customers then only the customer needs to change, not also the ReportBuilder" sound overly simplistic to me. The whole point would be that nothing needs to be changed. You just write a new ReportBuilder that implements the same contract/interface and switch the wiring. No changes in the existing ReportBuilder or Customer classes.

That, or maybe I'm just completely misunderstanding what I'm reading. Which isn't entirely impossible :-)

Re:Your DI framework is killing your code by to3m on Tuesday September 29, 2015 @09:01AM (#10295892)
Every business will have an order price factory in it. Prices aren't just picked by the roll of a dice!

If you're trying to model the inner workings of a business, you probably don't want to be starting with the customer's view of it...

Re:Your DI framework is killing your code by mjt0229 on Tuesday September 29, 2015 @08:49AM (#10295831)
I don't think the author makes a good case for the problem with, for example, noun-verbers, other than that they aren't very OO. If OO means putting lots and lots of state into objects, then I'm happy to be the lunatic fringe.

I like my objects as a unit of code organization and my value objects as simply that - an immutable representation of a value.