Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

12
  • What kind of application are you developping ? Typical industry application which just manage data with a lot of form look like this because there is no need to encapsulate of business data, you encapsulate persistence and so on, which is logic. On the opposite if you program a game engine, anything internal to the engine should not be exposed. If you need to redesigned for DI, this likely means that your design was wrong from the beginning. Commented May 17, 2017 at 7:51
  • 4
    It seems you are intermixing "use of a DI container" with "DI" itself. Can you please edit your question and clarify where you actually mean DI and where you mean "use of a DI container"? These are two different things. Commented May 17, 2017 at 7:52
  • 1
    Related blog post: Dependency injection discourages object-oriented programming? Commented May 17, 2017 at 7:57
  • 1
    @DocBrown I am not sure if my problems are caused by DI container, or DI itself. I really like automatic dependency handling by DI container, which is really easy to configure in web application. I've seen this blog before, but I think that it introduces too much bloat. Basically all my Somethings would turn into SomethingFactory creating Something. I think it is too much bloat, my coworkers already complain on too much bloat. There is no simpler way? Commented May 17, 2017 at 8:38
  • 1
    Relevant quote from the blog post of DocBrown : Rich vs anemic domain models is a whole other discussion. For the record, I think that using an anemic model is a perfectly fine approach, just the code needs to be organized in a different way. "it depends" ;). Commented May 17, 2017 at 8:45