I need help settling a disagreement, a co-worker and I have. We're working on a pretty huge Angular project and are in the process of looking at incorporating some Domain Driven Design principles into our project.
While we were looking at this picture, we discussed how our Dependency Injection Framework would factor into this.
My stance: Dependency Injection Frameworks should be used for Application Services, Domain Services, Repositories and Factories only. Domain Objects on the other hand are basically newable (though not typically newed except inside a factory) and don't have any constructor dependencies themselves.
His stance: That is impossible, because we have a DI-Framework and we should use it. His fear are huge monolith classes. He argues, that when classes have too many methods it's perfectly normal to split these into into smaller classes (because of the SRP) and bundle them in some sort of instrumentor class. This would be a chore without dependency injection. He claims, that DI-Frameworks are normal to use in every bigger project, and not using as much is possible is foolish.
Why it's so hard for me to convince him: We work with tables a lot and there is a class, that more or less represents the 'model' of a table (ignore for a second, that in most projects a 'table' is not really part of the problem domain, and accept the premise, that it might be in ours). Now first of all - even if our data and tables were simple - a class representing a table would have dozens of methods. Between adding and removing rows, resizing columns, getting and setting states like row selection, highlighting columns what have you.
Additionally even things that are conventionally simple, like adding a row, often have 5 different side effects on other parts of the table (these are actual requirements). So I think you can all agree, that having a 4000 line Table class is unacceptable. Consequentially we have to move some of its functionality to smaller classes, that only do one thing, or even just part of one thing. And now we're at an impasse. I think this still needs to be a class without dependency injection, but I don't know how to do it and he's adamant, that I'm just imagining this as a problem and wants to finagle services into the class, that do the jobs, that it conventionally should do itself.
So am I crazy? Is he crazy? Additionally, if you don't agree with him, you get bonus points for linking reputable sources, because 'anyone can write anything on stackoverflow'