Hacker News new | ask | show | jobs
by thomanil 6213 days ago
I concur. I also use Spring at my dayjob, without the problems the OP describes.

Spring is really useful for setting up the underlying infrastructure/plumbing/cross cutting concerns of a system - however, you don't have to use it for all your domain logic too. Don't drink the dependency injection cool-aid. :)

1 comments

I like dependency injection for wiring together configured singletons (such as factories). What I don't like is a trivial constructor and then injection via setters. Constructors should produce objects ready for use, and Spring tolerates doing it that way (though it seems to prefer setters).