I like Spring. I also think a lot of code reaches for a container before it has a problem a container solves.
What you actually get
A container gives you lifecycle management, scoping and a place to hang cross-cutting concerns. If your object graph is a few dozen singletons wired at startup, you are paying for all three and using one.
Wiring by hand in a single composition root is unfashionable and remarkably clear: the whole graph is one file you can read top to bottom, startup order is explicit, and tests construct exactly what they need without a context to boot.
Reach for the container when the lifecycle gets interesting. Request scopes, proxies and declarative transactions are real work you should not rewrite.
0 Comments
Leave a comment
Sign in to leave a comment.
Signing in is unavailable right now.







No comments yet.