Java is a great language that can run on any ecosystem. Spring framework was a great addition to java ecosystem, but it was built on philosophy of configuration over convention. That made the program to be configurable to great extent, and make any application that programmer liked. But at the same time, made it extremely difficult to learn, code, manage, migrate, deploy for beginners with limited knowledge. Getting help over specific topic was very hard as anything can be done through several methods, and lot could go wrong. Spring boot makes it easier for us to write java program with ease, using the flexibility of spring framework.
Spring boot is built on top of spring framework with philosophy of convention over configuration. Spring boot made easier for people to learn, get help when stuck, manage, migrate and deploy. It came in full package, from dependencies to the embedded server, software metrics, status etc. Beginners could make smart production ready software with less time they can use auto configuration, which reduces the hassle of setting up ton of configurations to get it run.
Steps to follow to learn Spring Boot
- Introduction to Spring Boot—Goals and Important Features
- Create Spring Applications Prior to Spring Boot
- Creating a Spring Boot Application with Spring Initializr
- Creating a Simple REST Controller
- What is Spring Boot Auto Configuration?
Spring-based applications have a lot of configuration. When we use Spring MVC, we need to configure component scan, dispatcher servlet, a view resolver, and web jars(for delivering static content), among other things. When we use Hibernate/JPA, we would need to configure a datasource, an entity manager factory, and a transaction manager, among a host of other things. The Spring Boot brings in a new thought process around this: Can we bring more intelligence into this? When a spring mvc jar is added into an application, can we auto configure some beans automatically?
- Spring Boot vs. Spring vs. Spring MVC
- Spring is about Dependency Injection. It makes it easy to develop loosely coupled applications. It makes applications testable.
- Spring MVC brings loose coupling to web MVC application development with features like Dispatcher Servlet, View Resolver, etc.
- Spring Boot eliminates the need for manual configuration with Spring and Spring MVC. You can use Spring and Spring MVC without needing a lot of configuration.
- Spring Boot aims to enable production-ready applications in quick time.
- Actuator : Enables Advanced Monitoring and Tracing of applications.
- Embedded Server Integrations : Because the server is built into the application, I don’t need to install a separate application server on the server.
- Default Error Handling
- Spring Boot Starter Projects: Starter Web and Starter JPA
Starters are a set of convenient dependency descriptors that you can include in your application. You get a one-stop-shop for all the Spring and related technology that you need, without having to hunt through sample code and copy-paste loads of dependency descriptors. For example, if you want to get started using Spring and JPA for database access, just include the spring-boot-starter-data-jpa dependency in your project, and you are good to go.
- A Summary of the Different Spring Boot Starter Projects
As we see from Spring Boot Starter Web, starter projects help us to quickly get started with developing specific types of applications.
- SOAP Web Services and RESTful applications
- Unit Testing and Integration Testing
- Add HATEOAS features to your services.
- Authentication and Authorization using Spring Security
- Spring Data JPA with Hibernate
- Enabling Spring Framework’s caching support
- Expose Simple REST Services using Spring Data REST
- To add advanced features such as monitoring and tracing to your application right away.
- To pick your specific choice of Embedded Servlet Container
- For Logging using Logback
- Logging using Log4j2
- Spring Boot Actuator
The Spring Boot starter actuator actually exposes a lot of REST services, and these services are compliant with the standard called the HAL standard. And we would use a hal explorer so that we can browse through the data which is provided by these services. The Spring Boot Actuator exposes a lot of data-application info: metrics, dump, beans, env, config properties, audit events, heap dump, loggers, trace, health mappings, and auto config. The Actuator provides more metadata about your application.
- Spring Boot Developer Tools
No comments:
Post a Comment