Category Archives: Spring

Spring Boot

 Spring Boot

  • Easy to create standalone applications
  • Handles predictable setup for developer e.g. If JPA implementation is on the classpath, it will automatically create JPA Entity Manager Factory
  • Embed containers (Tomcat, Jetty etc)
  • Automatically configure Spring components wherever possible
  • Very useful for rapid development
  • It is NOT code generator or IDE plugin

What does @SpringBootApplication do?

It adds following annotations

  • @Configuration tags the class as a source of bean definitions for the application context
  • @EnableAutoConfiguration tells Spring Boot to start adding beans based on classpath settings, other beans, and various property settings
  • It automatically adds @EnableWebMvc when it sees spring-webmvc on the classpath. This flags the application as a web application and activates key behaviours such as setting up a DispatcherServlet
  • @ComponentScan tells Spring to look for other components, configurations, and services in the package, allowing it to find the controllers

Spring Boot Parent POM and common starter dependencies

Parent POM

<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>

Common Starter Dependencies

<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>

  • spring-boot-starter
  • spring-boot-starter-web
  • spring-boot-starter-test
  • spring-boot-starter-jdbc
  • spring-boot-starter-jpa
  • spring-boot-starter-batch

Resources

Spring Framework

Spring Framework

  • Lightweight ( Spring apps do not require JEE application server)
  • Spring serves as Container for application objects (serves as lifecycle manager)
  • Open Source Application Framework (provides framework classes to simplify working with lower-level technologies)
  • Inversion of Control Container for Java platform

Spring Framework Modules

Spring Framework Modules

  1. Spring Core Container
  2. Aspect Oriented Programming (AOP)
  3. Authentication and Authorization
  4. Convention over Configuration
  5. Data Access
  6. Inversion of Control Container
  7. Messaging
  8. Model View Controller (MVC)
  9. Remote Access Framework
  10. Transaction Management
  11. Remote Management
  12. Testing

Core Container

Consist of spring-core, spring-beans, spring-context, spring-context-support and spring-expression

Resources