Skip to main content

Instructor-led training

Introduction to the Spring 4 Framework (The Next Generation) Training in Port Hueneme, California

The course starts with in-depth coverage on using the powerful capabilities of Spring's Core module to reduce coupling and increase the flexibility, ease of maintenance, and testing of your applications.

What you'll learn

The course starts with in-depth coverage on using the powerful capabilities of Spring's Core module to reduce coupling and increase the flexibility, ease of maintenance, and testing of your applications. It goes on to cover many of the most important capabilities of Spring, including integrating persistence layers (e.g. Hibernate/JPA) with Spring, using Spring's powerful Aspect Oriented Programming (AOP) to program cross-cutting concerns in a safe and maintainable way, and using Spring's declarative transaction capabilities. It also covers integration of Spring with Java EE Web applications. This course is hands on with labs to reinforce all the important concepts. It will enable you to build working Spring applications and give you an understanding of the important concepts and technology in a very short time.

Private Training for Teams

This course is offered as private, instructor-led training for organizations, onsite in Port Hueneme, California or live online. Dates, delivery format, and course content are arranged around your team's requirements.

This course is not currently scheduled as a public class for individual enrollment.

Request Group Training

Prerequisites

Programmers with experience in working with Java and Object - Oriented (OO) programming.

Course Outline

 
Session 1: 
Introduction to Spring
Overview of Spring Technology
Challenges for Modern Applications
Motivation for Spring, Spring Architecture
The Spring Framework
Spring Introduction
Managing Beans
Inversion of Control / IoC, Dependency Injection / DI
Configuration Metadata Overview, Configuring Beans (XML)
The Spring Container
Overview of the Spring Container
A Simple Spring Example
ApplicationContext Overview
ClassPathXmlApplicationContext, FileSystemXmlApplicationContext, AnnotationConfigApplicationContext
API and Usage
Dependencies and Dependency Injection (DI)
Examining Dependencies
Dependency Inversion
Dependency Injection (DI) in Spring - Basic Configuration and Usage
 
Session 2:  
Configuration in Depth
Annotation Driven Configuration
JSR 330 (@Named) and Spring (@Component) annotation styles
@Named/@Component, @Inject/@Autowired, @Repository, @Service
Configuring Beans and Autowiring with Annotations
Enabling Annotations - context:component-scan
Pros and Cons
Java Based Configuration (@Configuration)
Overview - code-centric Configuration
@Configuration and @Bean
Dependency Injection
Resolving Dependencies on Other Beans, Injecting Configuration Classes
Pros and Cons
Integrating Configuration Types
Choosing a Configuration Style
Integrating Configuration Styles
Importing: @Import and
Scanning with @Configuration style
Bean Scope and Lifecycle
Bean Scope Defined - singleton, prototype, and Other Scopes
Configuring Scope
Bean Creation Lifecycle, Lifecycle Callbacks
BeanPostProcessor, Event Handling
 
Session 3:  
Wiring in Depth
Value Injection
Configuring Value Properties, Property Conversions
Externalizing Values in Properties Files
Constructor Injection
Constructor Injection Overview
Configuration - @Configuration and XML
p: and c: namespaces for XML configuration
Qualifiers / Domain Specific Language (DSL)
Limitations of Autowiring
Qualifiers and DSL
Creating and Using an Annotation-Based DSL for Bean Configuration
Benefits of Qualifiers for Bean Configuration
Profiles
Profiles Overview
Configuring Profiles (XML and @Configuration)
Activating Profiles
Overview of SpEL
 
Session 4: 
 Database Access with Spring
Overview of Spring database support
Configuring a DataSource
Using Spring with Hibernate
High Level Hibernate Overview
SessionFactory configuration, LocalSessionFactoryBean
Contextual Sessions and Spring Integration
Using Spring with JPA
Managing the EntityManager (EM)
LocalContainerEntityManagerFactoryBean and Container-managed EMs
JEE and JNDI Lookup of the EM
Configuration and Vendor Adaptors
Creating a JPA Repository/DAO Bean - @PersistenceUnit, @PersistenceContext
 
Session 5:  
Aspect Oriented Programming (AOP)
Overview of AOP
Crosscutting Concerns
AOP Basics, Aspect, Joinpoint, Advice, Pointcut
Spring AOP Introduction
Configuration - XML and @AspectJ
Defining an Aspect, Pointcut, and Advice
How Advice is Triggered
Pointcut Expressions and Advice
Pointcut Expression Overview
The execution() Designator
Other Designators (within, target, args, @target, ...)
Kinds of Advice - before, after, around, after-returning, after-throwing
Marker Annotations (Rubber Stamp AOP)
Issue with AOP Configuration
Defining an AOP Marker / Rubber Stamp
Configuring AOP Using a Marker
Advantages of Marker Annotations
@AspectJ Based AOP Support
@AspectJ Annotations Overview
Defining an Aspect, Pointcut, and Advice
Other Considerations
Spring AOP Proxies and Self-Invocation Issues
Load-Time Weaving
Caveats of AOP
 
Session 6:  
Spring Transaction (TX) Management
Intro to Spring Transaction Management
Spring Transaction Managers
Spring Declarative TX Management
Spring TX Scope and Propagation
Spring TX Attributes (REQUIRED, SUPPORTS, etc)
XML Configuration of Transactions
Specifying Advice, TX Attributes, and Methods
Linking Advice with Pointcuts
Benefits of XML Configuration of TX Behavior
 
Session 7:  
Web Applications with Spring
Integrating Spring with Java EE Web Apps
ContextLoaderListener
WebApplicationContext
Using Spring beans in Wep app controller logic
Session 8:  XML Specific Configuration
Collection Valued Properties - Configuring and using lists, sets, etc.
Additional Capabilities
Factory Classes and Factory Methods
Definition Inheritance (Parent Beans)
AutoWiring with XML
Inner Beans, Compound Names
Appendix:  Maven and Spring

Why Spring is hard to learn from the outside in

The Java is usually not the obstacle. Spring moves object creation, wiring and method interception out of application code, so a mistake often shows up at startup or as behavior you never wrote. The syllabus layers the ideas so each one supports the next.

  • Sessions 1-3: how beans are defined and wired. Inversion of control and dependency injection come first, then three ways to declare beans: XML, annotations (@Component/@Named, @Autowired/@Inject) and @Configuration/@Bean. Scope, lifecycle callbacks, BeanPostProcessor, value injection, qualifiers, profiles and an overview of SpEL follow. A common misconception is that the styles are interchangeable. The course has you compare their pros and cons and combine them with @Import and component scanning.
  • Session 4: persistence. Hibernate and JPA integration depends on understanding the container. LocalSessionFactoryBean, LocalContainerEntityManagerFactoryBean, @PersistenceContext and JNDI lookup of the EntityManager are all bean configuration problems.
  • Sessions 5-6: AOP and transactions. Declarative transactions are AOP applied to your beans. Pointcut expressions (execution(), within, args), the kinds of advice, proxy behavior and self-invocation are the hardest part. The syllabus names self-invocation and load-time weaving as caveats. Transaction attributes such as REQUIRED and SUPPORTS, and propagation, build directly on that proxy model.
  • Sessions 7-8: web integration and XML detail. These cover ContextLoaderListener and WebApplicationContext, then collections, factory methods, parent beans and inner beans in XML.

Who it suits and what to take around it

This is an introductory, three-day course for programmers who already work in Java and object-oriented design. It suits developers joining or maintaining an application that uses Spring, and teams that want to cut coupling and make code easier to test. Those who need Java fundamentals first can start from the Java Programming courses and learning guide.

The web material is limited to bootstrapping Spring inside a Java EE web application and using beans from controller logic. Developers who need the web layer itself can continue with Introduction to Spring 4, Spring MVC, and Spring REST, which has a longer web focus. Teams on a different Spring generation can compare the other Spring courses in the full course catalog.

Illustrative scenarios

The scenarios below are illustrations of how the course material can be applied. They are not descriptions of specific organizations or of the course's lab exercises.

  • Environment-specific wiring. A team might need different DataSource settings for development and production. Profiles, externalized property values and @Configuration classes let one codebase switch environments without editing code.
  • A repository layer on JPA. A developer might replace hand-written session handling with a JPA repository bean. The EntityManager comes from LocalContainerEntityManagerFactoryBean and is injected with @PersistenceContext, while declarative transaction attributes define the boundaries.
  • Cross-cutting behavior in one place. A team might want timing or audit logging on service methods. An @AspectJ aspect with an execution() pointcut and around advice, or a marker annotation, keeps that logic out of business code. Knowing the self-invocation caveat explains why some internal calls skip the advice.

AI coding assistants with these topics

AI coding assistants are useful for scaffolding @Configuration classes, stereotype-annotated components and repository boilerplate, and for drafting JUnit tests. They also help convert between XML and Java configuration.

They tend to fail where behavior depends on runtime wiring. Typical problems:

  • Advice that never runs because of proxy self-invocation, or pointcut expressions that match too much or too little.
  • Wrong transaction attributes or propagation, or transaction annotations on methods the proxy cannot intercept.
  • Mixed configuration styles that produce duplicate or ambiguous beans.
  • Suggestions written for a different Spring or Java EE API generation than the project uses.

To verify, run the application context in tests and check which beans exist and how they resolve. Confirm that advice fires by asserting on observable effects. Check transaction boundaries and rollback behavior against a real or test database. Compare every import and API against the versions your project actually uses.

Frequently asked questions

What level is this course?

It is introductory and runs three days. It assumes you can already write Java and understand object-oriented programming, but it needs no prior Spring experience.

What are the prerequisites?

Experience programming in Java and with object-oriented concepts. Familiarity with Java EE web applications and with relational persistence helps in the sessions on database access and web integration.

What does the course cover?

It covers the Spring container, IoC and DI, XML, annotation and Java-based configuration, bean scope and lifecycle, value injection, qualifiers and profiles. It also covers Hibernate and JPA integration, AOP with pointcuts and advice, declarative transaction management, and Spring in a Java EE web application. XML-specific features and a Maven appendix round it out.

Can it be delivered privately for our team?

Yes. HSG delivers private training for organizations, onsite at the client's location or live online.

Can the content be customized?

Private course content can be customized, including tailoring to the technology versions your organization uses. You can describe your needs through the training proposal request.

Training locations

Introduction to the Spring 4 Framework (The Next Generation) training across the U.S. and beyond.

We provide private Introduction to the Spring 4 Framework (The Next Generation) training for organizations, onsite at your location or live online, throughout the United States and internationally.

View all Introduction to the Spring 4 Framework (The Next Generation) training locations

Train your team with HSG

Private, instructor-led training customized for your organization.

  • Onsite or live online delivery
  • Customized curriculum
  • For a single employee or an entire team
  • Flexible scheduling
  • Experienced instructors
Request Group Training

Questions? Call us at 303.377.6176
or email info@hartmannsoftware.com

Ready to train your team?

Let's customize this training for your organization.

Tell us about your employees, your goals, and your preferred schedule. We'll prepare a training proposal covering scope, delivery format, and pricing.