Spring Framework
Actionable Items for Blogging
- Course Material Reference
- Diagrams and Pics
- Others
What is Spring?
Meet the Spring Family
The Spring family all began with the creation of the Spring Framework, which was built largely in response to the complexity of developing applications using Java’s enterprise framework called J2EE, it’s now called Java EE, and the Spring Framework aimed at removing the complexity and helped to make things like web development and data access easier for developers to implement. It also aimed at reducing boilerplate code, and if you’re not familiar with what that is, it’s repetitive code that’s often needed as part of the logic, but tends to clutter the application and draw focus away from the main logic. The Spring Framework is still heavily used today, and it’s the foundation upon which everything else is built. The success of the Spring Framework led to the creation of several Spring projects that were built on top of the Spring Framework, but tailored to specific needs or domains. For example, the Spring Security project was created to remove the complexity and challenges with securing a Java application, and another project, like the Spring Data project, was created to further simplify data access in Java applications. The Spring Framework and Spring projects continued to evolve and thrive, eventually resulting in the creation of a particularly impactful project called Spring Boot. Spring Boot was a real game changer. It provided a new and drastically faster way of building Spring-based applications. Up until Spring Boot, building a Spring-based application had always involved a lot of choice making, configuration, and a cumbersome deployment model. Spring Boot removed all of that by taking an opinionated view of building Spring-based applications including sensible defaults for library choices and configuration, and adding smarts for auto-detecting and auto-configuring other common configurations. It also massively simplified the deployment process and made running a Spring-based application as simple as running a single command. Lastly came the Spring Cloud project. Spring Cloud was built on top of Spring Boot and simplified the development of applications that make use of distributed architectures, such as microservice architectures, and these type of architectures often have many common patterns that are implemented, such as service discovery and distributed configuration, and Spring Cloud helped to make it easier for developers to build applications that use those patterns. Now that we’ve been introduced to the Spring family, let’s take a look at why we would want to use it.
Why Spring?
So why Spring? And oftentimes you’ll hear people asking, why would I want to use Spring? And that’s probably something you may be even thinking for yourself right now. And one of the common answers you’ll hear is that it’s a good alternative to Java EE, and while that was true in the beginning, today Spring is so much more than just an alternative to Java EE. In fact, it’s actually complimentary to Java EE and makes use of several of the standard specifications like the Java Persistence API. The question of why you would want to use Spring is a completely valid and reasonable question that actually has a very simple answer, and that’s that creating software can be hard, seriously, and Spring helps make it easier. You’ll notice that regardless of the project within the Spring family, they all share a common theme, and that’s to make developing Java applications easier. Let’s talk about some other reasons why Spring is a good choice. First, Spring is really great at being flexible, modular, and especially backwards compatible. So Spring is far from an all‑or‑nothing type of choice. In fact, you’re given the freedom to pick and choose whichever parts of Spring make the most sense for your project. And what’s really great about that is that you can be sure that the investment you’re making with Spring won’t be wasted when a new version is released. Spring also has a very large and active community, and in my opinion this is often one of the things that’s overlooked and taken for granted when assessing technologies, but it makes a huge difference. With Spring, you can be sure that there’s a wealth of knowledge that already exists out there, and if you run into a problem, it’s likely that someone else has already ran into that same problem, and they can probably help you through it. And lastly, what makes Spring a good choice is that it’s continually innovating and evolving. Being an open‑source project but fully backed by a company called Pivotal allows Spring to remain healthy and alive, while at the same time pushing the bounds of enterprise Java development. It’s not uncommon for Java’s standards or specifications to be influenced or based on ideas that originated within Spring.