3 ms·
I've started using java just recently, spent years in C/C++/etc... So is spring the java equivalent of boost?
by malkia 12y ago
I've started using java just recently, spent years in C/C++/etc... So is spring the java equivalent of boost?
- twic 12y agoNot quite. Although i don't know C++ well enough to be sure. Spring started life as a dependency injection framework, and that still constitutes the central part of it. Dependency injection is the mechanism by which components of an application are created and assembled, and so there was a natural expansion of Spring into providing those components. Spring now provides a web framework, plumbing for database persistence, batch processing, and all sorts of other things: https://spring.io/platform https://spring.io/platform AIUI, Boost is a collection of libraries. Spring is much more frameworky than that. The general approach with Spring is to add a particular module to your project, sprinkle a few magic annotations on your code, then watch in wonder as lots of sophisticated stuff happens, exactly as Spring's designers foresaw. Usually. There are two main alternatives to Spring. Firstly, Java EE, which is similar in spirit, smaller in extent, and the product of a decades-long standards process involving some of the world's most ponderous companies, but really not as bad as that might suggest: http://www.oracle.com/technetwork/java/javaee/overview/index.html http://www.oracle.com/technetwork/java/javaee/overview/index... And in fact, i'd describe Spring as an alternative to Java EE, rather than vice versa. Secondly, not using a framework at all, and just putting everything together yourself. To a large extent, Dropwizard etc are the result of people doing this, then posting the reusable bits of their application to GitHub. Java's equivalent of Boost is probably some combination of Apache Commons: http://commons.apache.org/ http://commons.apache.org/ And Google Guava: https://code.google.com/p/guava-libraries/ https://code.google.com/p/guava-libraries/ The difference is that if you're using Spring, then you are writing a Spring application. Every part of your code will be pervaded by Spring, and you will have to do things in the way Spring prescribes. If you're using Commons or Guava, your application is your own, and those libraries will crop up here and there, where you choose to use them.