Saturday, May 12, 2018

Spring Boot explained simply


Why Spring Boot

Spring Boot gives us a new level of abstraction in the server software building. As for the Spring Framework version 2.x and less the main building block was a bean. Or a class in other words. Which was declared in the XML application context file. And the most popular approach was layered architecture: they were grouped by functional roles like persistence, integration, services, DAOs, etc.

With time programs became more and more complex and starting from the version of 2.5 a new feature like component scanning was introduced in Spring. And thus new building block of the program became a package. One package - one feature. And at the same time developers still required to develop and configure some infrastructure code like Dispatcher Servlet, typical Jackson configuration and etc.

At the current time of software complexity we can manage tens and hundreds of microservices in one product, and typical building block is the Microservice or and application typically deployed on a separate JVM. So the Spring Boot is intended to give the developers nice tool to solve this problem. And at the same time is brings a lot of pre-configured functionality mainly responsible for the same infrastructure things described above.

What is Spring Boot

1. This is a lots infrastructure things included and configured by default.

By default configured Dispatcher Servlet for the web app, Jackson mapper, logging, Spring MVC config is created and preconfigured using default settings, etc.

2. These standard infrastructure configs and beans are simply configured or customized by text files.

For example see how simply configured by default Jackson Object Mapper could be customized by text file:  https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#howto-customize-the-jackson-objectmapper

3. Frameworks integrations. They are recognized by the availability in the classpath. Auto-configurations.

Web servers like Jetty or Tomcat, MongoDB client and connections, Cassandra and others

4. Ready to use infrastructure to monitor the application. Spring Boot Actuator framework.

5. Additional Spring framework improvements like set of @Conditional* annotations and property holders (mapping text props to the POJO)

All these features allow developer spend less time on the standard things and configurations and stay focused on the business features development. Get ready boilerplate apps or the templates in one minute.

That's it about Spring Boot in two words to get the main idea and start creating your app from here: http://start.spring.io.

Design Patterns Wrapper revisited

 Now lots of software designed and developed following microservice architecture. Components need to communicate with each other via VO (val...