Logo

Maxtrain.com - [email protected] - 513-322-8888 - 866-595-6863

LP-FTSPR4

Introduction to the Spring 4 Framework (The Next Generation)

Alert Me

Description

Over the years, Spring has added many new capabilities, in line with the increasing capabilities of the Java platform. As well as being current with Spring 4, this course introduces techniques for using these powerful capabilities. It includes complete coverage of the three main configuration styles: Java-based (@Configuration), annotation-based (@Component), and the traditional XML-based configuration that may still play an important role in existing and new projects. It also provides guidelines for when and how to use each one.

This 3 day instructor led 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.

The standard platform does all labs with the Eclipse IDE, and the lab instructions include detailed directions for setting up and using it. The course can be made available for all major development environments, including IBM RAD and IntelliJ.

At course completion student will:

  • Understand the core principles of Spring, and of Dependency Injection (DI) / Inversion of Control
  • Use the Spring Core module and DI to configure and wire application objects (beans) together
  • Know the different types of metadata (XML, annotations/@Component, and Java Configuration/@Configuration), and how and when to use them
  • Understand and use the complete capabilities of the Core module, such as lifecycle events, bean scopes, and the Spring API
  • Work with the ORM (Object-Relational Mapping) module to integrate Spring with technologies such as Hibernate or JPA.
  • Understand and use Spring’s powerful AOP capabilities for programming cross-cutting concerns across multiple points in an application
  • Learn safe and maintainable techniques for programming with AOP
  • Understand and use Spring’s transaction support, including the easy-to-use Java annotation support, as well as the tx/aop XML configuration elements
  • Integrate Spring with Java EE Web applications

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)
  • Overview of the Spring Container
  • A Simple Spring Example
  • ApplicationContext Overview
  • ClassPathXmlApplicationContext, FileSystemXmlApplicationContext, AnnotationConfigApplicationContext
  • API and Usage
  • Examining Dependencies
  • Dependency Inversion
  • Dependency Injection (DI) in Spring - Basic Configuration and Usage
  • The Spring Container
  • Dependencies and Dependency Injection (DI)

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
  • Choosing a Configuration Style
  • Integrating Configuration Styles
  • Importing: @Import and
  • Scanning with @Configuration style
  • Bean Scope Defined - singleton, prototype, and Other Scopes
  • Configuring Scope
  • Bean Creation Lifecycle, Lifecycle Callbacks
  • BeanPostProcessor, Event Handling
  • Integrating Configuration Types
  • Bean Scope and Lifecycle

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
  • Limitations of Autowiring
  • Qualifiers and DSL
  • Creating and Using an Annotation-Based DSL for Bean Configuration
  • Benefits of Qualifiers for Bean Configuration
  • Profiles Overview
  • Configuring Profiles (XML and @Configuration)
  • Activating Profiles
  • Qualifiers / Domain Specific Language (DSL)
  • 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 Expression Overview
  • The execution() Designator
  • Other Designators (within, target, args, @target, ...)
  • Kinds of Advice - before, after, around, after-returning, after-throwing
  • Issue with AOP Configuration
  • Defining an AOP Marker / Rubber Stamp
  • Configuring AOP Using a Marker
  • Advantages of Marker Annotations
  • @AspectJ Annotations Overview
  • Defining an Aspect, Pointcut, and Advice
  • Spring AOP Proxies and Self-Invocation Issues
  • Load-Time Weaving
  • Caveats of AOP
  • Pointcut Expressions and Advice
  • Marker Annotations (Rubber Stamp AOP)
  • @AspectJ Based AOP Support
  • Other Considerations

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

PreRequisites

A good working knowledge of basic Java, JDBC, and Servlets/JSP.

Audience

Java developers who need to work with Spring based applications.

$1575.00 List Price

3 Days Course

Class Dates

Request a Date or a Private Class below.


Category:
Loading ...