4 ms·
There're two parts: why java, and why it's so popular in java. About Java there are many reasons, I think, like it's very strong, rich ecosystem, a lot of libr
by splix 11y ago
There're two parts: why java, and why it's so popular in java.
About Java there are many reasons, I think, like it's very strong, rich ecosystem, a lot of libraries, for everything, mostly well documented, os independent so you could distribute you app in binary form, etc. Last one is very important - you'll need only compiled .war file of your app, rather that installing this crazy amount of libs on target system, as you do in python/ruby (thanksgod Docker is going to help there). So, for many people, it's less ricky to choose Java (or JVM), know that it will be stable and focus on something else
Why Spring for JVM? probably because we don't have any good alternative. I can recommend Grails, it's good for many cases, I like it personally, I'm using it for simple projects since 2007 I guess, author of several plugins, etc. But I can't say that it's as solid as Spring. There're many other frameworks, some of them small and undocumented, some just outdated (like Struts), some too niche (like Vaadin), and so on. Spring is most universal, most flexible, most documented and have largest community. And don't forget that it's not just web framework, Spring MVC is just _one_ module of much bigger project.
I guess you've started with Spring no so long ago, right? so you got this confusion with configuration, with "magic", etc. Looks like you're mixing different types of ways of using Spring, maybe because you've read different docs/tutorials/SO answers/blogs posts, each of them for different versions, for different architecture, for different conventions. That's common. All could be mixed together, but it just makes it complicated and "magical". Spring is not forcing you to choose one way, not telling you how you should design your app, that's all up to you, there is not just one right way, but many. And it takes time to learn this. Spring is designed pretty logically, follows some rules, and at some point of time you'll get it, you'll get whole Spring at once, everything will be clear and logical, you'll know (or feel?) how to use it. But it takes a time, maybe months, maybe weeks.
PS and remember, nobody forces you to use Java for Spring, I prefer Groovy, for example. Same for XML, you don't need it, annotations + *Configurer can do all job for you
- vorg 11y ago> Spring for JVM? [...] I can recommend Grails > nobody forces you to use Java for Spring, I prefer Groovy Recently the Groovy/Grails sponsor VMWare split them off from Spring and retrenched all the developers working on them, while keeping their ownership of Spring. The only reason I can think of is they didn't want Spring dependent on Groovy or Grails in any way, so if you use either of them with Spring, you might have incompatibility problems in future.