WA1850

Spring 6 Fundamentals Training

This Spring Framework course teaches developers the fundamentals of the Core Spring framework for Java, as well as related principles such as dependency injection and inversion of control.
Course Details

Duration

2 days

Prerequisites

Working knowledge of Java programming, including use of inheritance, interfaces, and exceptions.

Skills Gained

  • Understand core Spring principles: Dependency Injection, Inversion of Control, and the benefits of coding to interfaces
  • Define and manage Spring beans using both XML and annotation-based configuration
  • Create unit and integration tests for Spring applications using Spring's testing framework and JUnit
  • Implement Aspect-Oriented Programming (AOP) to modularize cross-cutting concerns like logging and transactions
  • Integrate Spring with JPA to build Data Access Objects (DAOs) and interact with databases
  • Utilize Spring's JDBC support classes for direct database interaction
  • Apply declarative transaction management to ensure data integrity and consistency in Spring applications
Course Outline
  • Introduction to the Spring Framework
    • What is the Spring Framework?
    • Spring Philosophies
    • Coding to Interfaces
    • Dependency Injection
    • Easy to Test
    • Why Spring?
    • Spring Container
    • Quick Spring Example - @Configuration
    • Quick Spring Example - ApplicationContext
    • Avoiding Dependency on Spring
    • Additional Spring Projects/Frameworks
    • What is Spring Boot?
  • Defining and Using Spring Beans
    • Spring “Beans”
    • Spring ApplicationContext
    • Instantiating the Spring ApplicationContext
    • Retrieving Spring Beans
    • Configuration classes
    • @Bean methods
    • Overriding Bean Names
    • Uniqueness of Bean IDs / Names
    • Bean Scope
    • Effect of Bean Scope on Instances
    • Profiles
    • Profiles – Not.
    • Default Profile
    • Profile on @Configuration class
    • Eager vs Lazy
    • Lazy Bean Misuse
    • External Properties
    • @Value
    • @PropertySource
    • @PropertySource & @Profile
  • Defining Spring Beans - Annotations
    • Defining Beans with Annotations
    • @Component Annotation
    • @ComponentScan Annotation
    • Bean ID/name and Type
    • Scope, Profile, and Lazy
    • Constructors
    • Constructor injection with @Autowired
    • Setter injection with @Autowired
    • Constructor vs. Setter Injection
    • Field injection with @Autowired
    • Setting properties with @Value
    • Resolving Duplicate Beans
    • Disambiguation with @Qualifier
    • @PostConstruct
    • @PreDestroy
    • Java @Configuration vs Annotation Configuration
    • Alternate Annotations, JSR 330 @Named
    • JSR 330 @Inject Annotation
    • JSR 250 @Resource Annotation
  • Testing Spring Applications
    • Spring Testing
    • Unit Testing vs Integration Testing
    • Setup
    • Implementing JUnit / Spring Integration Tests
    • Shortcut - @SpringJUnitConfig
    • Accessing Spring Components Within Test Classes
    • Defining Tests to Execute
    • Testing
    • @DirtiesContext
    • Default Configuration
    • @ActiveProfiles
    • @TestPropertySource
    • @Transactional Testing Support
    • @Sql Database Support
    • JUnit Annotations
    • Other useful JUnit Annotations
    • Mock Objects
    • Sample JUnit test with Mockito (no Spring)
  • Introduction to Aspect-Oriented Programming
    • What is AOP?
    • Cross-Cutting Concerns
    • Cross-Cutting Concern Example
    • AOP Terminology
    • AOP in Spring
    • Understanding Proxy Objects
    • CGLib Proxies
    • AOP Example
    • Enabling Spring AOP
    • Five Advice Types
    • Pointcut Syntax
    • Pointcut Examples
    • @Before Example
    • @AfterReturning Example
    • @Around Example
  • Overview of Spring Database Integration
    • DAO Design Pattern
    • DAO Support in Spring
    • Spring Data Access Support
    • Spring JDBC Support
    • Defining DataSource Beans
    • Connection Pooling
    • Embedded Databases
    • Selecting a DataSource using @Profile
    • Spring ORM Support
    • DataAccessException
    • DataAccessException
    • @Repository Annotation
  • Spring JDBC Support
    • Spring JDBC Support
    • Main Spring JDBC Classes
    • Spring JdbcClient
    • Using JdbcClient
    • JdbcClient, Named parameters
    • Retrieving domain objects
    • RowMapper
    • Retrieving multiple domain objects
    • Updates with JdbcClient
    • Inserts with JdbcClient
    • JdbcTemplate
    • JdbcTemplate - Updates
    • JdbcTemplate – Query with RowMapper
  • Spring Transaction Management
    • Transactions
    • Declarative Transaction Management in Spring
    • PlatformTransactionManager
    • Bean ID = transactionManager
    • Transaction Management Setup – Step 1
    • Transaction Management Setup – Step 2
    • Transaction Management Setup – Step 3
    • What Will Spring Do?
    • Understanding Propagation
    • Transaction Behavior - Propagation
    • Transaction Behavior - Isolation
    • Read-Only and Timeouts
    • Setting attributes using @Transactional
    • Transaction Rollback
    • Limitations of Proxies
    • Proxy Work-Around - Self-Injection
    • Testing with @Transactional
  • Using Spring with JPA
    • Object to Relational Mapping Frameworks (ORM)
    • Java ORM frameworks
    • Using JPA in a Spring Application
    • JPA Metadata
    • EntityManagerFactoryBean
    • Understanding the EntityManager and Persistence Context
    • Primary EntityManager methods
    • Entity Lifecycle
    • Spring DAO based on JPA – part 1
    • Spring DAO based on JPA – part 2
    • Why @PersistenceContext, not @Autowired?
Upcoming Course Dates
USD $2,830
Online Virtual Class
Scheduled
Date: Jan 21 - 22, 2025
Time: 10 AM - 6 PM ET
USD $2,830
Online Virtual Class
Scheduled
Date: Mar 3 - 4, 2025
Time: 10 AM - 6 PM ET
USD $2,830
Online Virtual Class
Scheduled
Date: Apr 14 - 15, 2025
Time: 10 AM - 6 PM ET
USD $2,830
Online Virtual Class
Scheduled
Date: May 26 - 27, 2025
Time: 10 AM - 6 PM ET
USD $2,830
Online Virtual Class
Scheduled
Date: Jul 7 - 8, 2025
Time: 10 AM - 6 PM ET