3 ms·
At its core, Spring provides some niceties such as dependency injection, resource location, validation, and data binding, all for POJOs: you can use these featu
by St-Clock 16y ago
At its core, Spring provides some niceties such as dependency injection, resource location, validation, and data binding, all for POJOs: you can use these features in a regular app or in a web app. For other features such as persistence, you can see Spring as a meta-framework wrapping other frameworks (e.g., hibernate).
Spring Framework thus go way beyond web frameworks.
Disclaimer: I'm not a huge fan of Spring and I don't like "meta-frameworks", but to qualify it as a "web framework" is diminutive at best.
- rbanffy 16y agoAnd nothing Java can be diminutive ;-) Sorry. I have only used Spring in web-application contexts. The app I am currently maintaining (and going bald because of it) is not a shiny example of elegance and probably doesn't make Spring look particularly good either. Just as a side note, I wouldn't consider Java for web applications (because we have much better experiences with Django and Rails), but I wouldn't rule it out as easily for desktop apps. And I am also looking for an excuse to play more with Clojure.
- gthank 16y agoA lot of Spring code predates the rising popularity of "convention over configuration" (thank you, Rails, for getting this so widely accepted), so if you're in one of those code bases, you're going to see a LOT of the Java+XML verbosity that led to everyone lampooning Java. In exchange, you get a ton of flexibility. You probably only need 5-10% of it, but that 5-10% is NICE. The ability to do clean testing of your data tier, for instance, is glorious when you first experience it. Goodbye, horrible ResultSet mocks! If you're lucky enough to work on a codebase that fully embraces autowiring and all the spiffy new annotations, then you get all this awesome stuff, but with virtually none of the crazy XML configuration stuff that makes it impossible to just trace the source and figure out what the hell is going on. For Java web frameworks, Play! http://www.playframework.org/ http://www.playframework.org/ is definitely on the top of my list for green-field projects. I've only used it on small things so far, but it really seems to have learned the lessons of Django and Rails. https://github.com/weavejester/compojure https://github.com/weavejester/compojure is on my To-Try list for Clojure stuff. Until I get around to it, I'm just monitoring buzz on the web, but so far it's been mostly positive.
- rbanffy 16y agoI heard very good things about VRaptor (http://vraptor.caelum.com.br/en/ http://vraptor.caelum.com.br/en/). It may be able to convince me to forgive Java.
- ldh 16y agoDefinitely try out Clojure for web apps. I'm currently loving the bare minimalism of Ring/Compojure/Hiccup.
- vicaya 16y agoFor a true lightweight modern web framework in Java that's based on Guice, checkout my little embedded web framework for the next generation of Hadoop. https://issues.apache.org/jira/browse/MAPREDUCE-2399 https://issues.apache.org/jira/browse/MAPREDUCE-2399 No XML, no YAML, no config/properties files, no templates. Everything is statically checked by java compiler with instant feedbacks in an IDE. It's better than rails :)