Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I have to use Spring at work in a pretty large Enterprise Java environment, and our setup is not as you describe.

Despite Spring's message of conformity, it doesn't actually force you to program everything as singletons and beans.



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. :)


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).




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: