As I stumble upon Spring all the time when reading about state-of-the-art development techniques, I want to understand better what it is. (I mentioned in one of my first articles that I got some homework to do… 🙂 )
I started with watching this youtube-video of 2015 where Josh Long, part of the Pivotal-team, gets some basic information how to get started with Spring Boot development:
The video title is already mentioning Spring Boot, on other places I read about Spring Cloud… I would like to clarify those different aspects in this article.
First of all: What does wikipedia say?
The Spring Framework is an application framework and inversion of control container for the Java platform. The framework’s core features can be used by any Java application, but there are extensions for building web applications on top of the Java EE platform. Although the framework does not impose any specific programming model, it has become popular in the Java community as an alternative to, replacement for, or even addition to the Enterprise JavaBeans (EJB) model. The Spring Framework is open source.
Understood: application framework for Java platform, usable by nearly any Java application, so a quite remarkable target group.
Inversion of control describes a design principle which somehow inverts the reusability patterns inside source code. Wheres reusable libraries are specifically called inside the code, IoC means the framework calls into the custom code.
Dependency injection is one important aspect for that. Spring offers for example the possibility to give application context via xml-files to the application. So instead the need to write a specific implementation for every type of object, you can just write the code for a more abstract class and execute the method depending on the given application context.
This makes testing easier because you need less testing classes.
(Pretty high level description, but the next part is even more important to understand!)
While doing my research, I stumbled upon the most interesting part of Spring for me so far, which is already mentioned in the video above:
Spring Boot is a simple way to bootstrap your application. Pretty easy sentence and that’s also what Spring Boot should be: easy. You can go somewhat “shopping” on start.spring.io and select what components your application should contain. When you click “generate project”, you’ll get it all set up .
What you get in the box is a full setup project including a Maven POM which is startable immediately (if you don’t choose any high-sophisticated components that need manual configurations before running). The project as such makes usage of the Spring framework, of course….
There are several “getting started” guides which I would recommend: Once you get your hands on, you can understand how easy it is to start application development with Spring Boot. It took me like 1h to set up my first Spring Boot application, but only because I had to setup Maven on my local machine… the second set up was done in like 10 minutes!
Check out this guide: https://spring.io/guides/gs/spring-boot/
….. So far for my early steps with Spring. Will keep you posted once I got more experience on that. Stay curious!
my source list:
- (book:) “Spring in Action – Fourth Edition” by Craig Walls, ISBN 978-1-617291-20-3, amazon