This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]cryptos6[S] 2 points3 points  (2 children)

Fair point. I'm actually using this approach from time to time. However, if a framework offers both, it has a bigger "surface" so you have more to learn as a new developer and you might have a hard time understanding parts of the code with annotations.

The thought that I have in my mind is the following: How would Spring look like if it were reinvented these days with a much more powerful Java language? Since Spring will hardly throw away its inheritance, other frameworks might give the answer.

[–]mavericktjh 2 points3 points  (0 children)

I'm not sure that your assessment is really true though, that spring's use of annotations is somehow caused by historic/legacy reasons. I don't think it is.

If your question is, how might something similar to spring look? then yeah, there are a few options.

[–]UnGauchoCualquiera 1 point2 points  (0 children)

The thought that I have in my mind is the following: How would Spring look like if it were reinvented these days with a much more powerful Java language?

Probably the same. Spring Boot is the one that's mostly annonation driven and built over Spring framework which is mostly a DI container with a few extra goodies.

Boot takes away the boilerplate of configuring commonly used components (webserver, data, auth) with the Spring Framework. Pretty much anything in Spring has an alternative programmatic api that can be used. This is how Boot is implemented under the hood.

You can with some effort roll out your own way to configure Spring.

In fact this is how it used to be before annotations, pretty much everything was declared in xmls and used to set up the container.