Trifork Academy is the official training partner of VMware in the Netherlands & exclusive provider of the Spring: Core Masterclass. Learn more from our CTO & Trainer, Joris Kuipers.

In this masterclass, you will build a Spring-powered Java application that demonstrates the Spring Framework & other Spring technologies such as Spring Boot, Spring Data, AOP and Spring Security.

Course Overview

Objectives & Prerequisites

By the end of the course, you should be able to meet the following objectives:

  • Spring configuration using Java Configuration and Annotations
  • Aspect oriented programming with Spring
  • Testing Spring applications using JUnit 5
  • Spring Data Access – JDBC, JPA and Spring Data
  • Spring Transaction Management
  • Simplifying application development with Spring Boot
  • Spring Boot auto-configuration, starters and properties
  • Build a simple REST application using Spring Boot, embedded Web Server and fat JARs or classic WARs
  • Implementing REST client applications using RestTemplate
  • Utilize Spring Boot enhancements to testing
  • Spring Security
  • Enable and extend metrics and monitoring capabilities using Spring Boot actuator

Prerequisites

We assume that participants have a good understanding of the core Java APIs, as well as a basic knowledge of general concepts like JavaEE APIs such as JTA and the Servlet API. As we cover object-relational mapping technologies (ORM) we also assume basic knowledge of ORM concepts and JPA. The masterclass is hands-on. Developers are expected to bring their own laptop.

Day 1: Spring Overview, Java Configuration, Annotation...

Spring Overview

  •  What is the Spring Framework
  •  The DI Container
  • The Spring Framework History and EcoSystem

Java Configuration

  • Java configuration and the Spring application context
  • @Configuration and @Bean annotations
  • @Import: working with multiple configuration files
  • Defining bean scopes
  • Launching a Spring Application and obtaining Beans

More Java Configuration

  • External properties & Property sources
  • Environment abstraction
  • Using bean profiles
  • Spring Expression Language (SpEL)

 Annotation and Component Scanning

  • Component scanning
  • Auto wiring using @Autowired
  • Java configuration versus annotations, mixing.
  • Lifecycle annotations: @PostConstruct and @PreDestroy
  • Stereotypes and meta-annotations

 Inside the Spring Container

  • The Spring Bean Lifecycle
  • The BeanFactoryPostProcessor interception point
  • The BeanPostProcessor interception point
  • Spring Bean Proxies
  • @Bean method return types

Day 2: Introduction to AOP, Testing Spring Applications, JDBC Simplification...

Introducing Aspect-oriented programming

  • What problems does AOP solve?
  • Defining pointcut expressions
  • Implementing various types of advice

 Testing a Spring-based Application

  • Spring and Test-Driven Development
  • Spring 5 integration testing with JUnit 5
  • Application context caching and the @DirtiesContext annotation
  • Profile selection with @ActiveProfiles
  • Easy test data setup with @Sql

 JDBC Simplification with Jdbc Template

  •  How Spring integrates with existing data access technologies
  •  Spring‘s JdbcTemplate
  •  DataAccessException hierarchy

 Transaction Management with Spring

  •  Transaction overview
  •  Transaction management with Spring
  •  Transaction propagation and rollback rules
  •  Transactions and integration testing

Day3: Spring Boot, Spring Data JPA & Web Applications with Spring Boot...

 Spring Boot – A closer look

  •  Dependency management using Spring Boot starters
  •  How auto-configuration works
  •  Configuration properties
  •  Overriding auto-configuration
  •  Using CommandLineRunner

 Spring Boot – Spring Data JPA

  •  Quick introduction to ORM with JPA
  •  Benefits of using Spring with JPA
  •  JPA configuration in Spring
  •  Configuring Spring JPA using Spring Boot
  •  Spring Data JPA dynamic repositories

 Web Applications with Spring Boot

  •  Introduction to Spring MVC and request processing
  •  Controller method signatures
  •  Using @Controller, @RestController and @GetMapping annotations
  •  Configuring Spring MVC with Spring Boot
  •  Spring Boot packaging options, JAR or WAR

Day 4: RESTful Application with Spring Boot, Spring Boot Testing...

RESTful Application with Spring Boot

  •  An introduction to the REST architectural style
  •  Controlling HTTP response codes with @ResponseStatus
  •  Implementing REST with Spring MVC, @RequestMapping, @RequestBody and @ResponseBody
  •  Spring MVC’s HttpMessageConverters and automatic content negotiation

 Spring Boot Testing

  •  Spring Boot testing overview
  •  Integration testing using @SpringBootTest
  •  Web slice testing with MockMvc framework
  •  Slices to test different layers of the application

 Securing REST Application with Spring Security

  •  What problems does Spring Security solve?
  •  Configuring authentication
  •  Implementing authorization by intercepting URLs
  •  Authorization at the Java method level
  •  Understanding the Spring Security filter chain
  •  Spring security testing

 Actuators, Metrics and Health Indicators

  •  Exposing Spring Boot Actuator endpoints
  •  Custom Metrics
  •  Health Indicators
  •  Creating custom Health Indicators
  •  External monitoring systems