Mastering the Spring Ecosystem

Dates: 9th to 11th October 2017

Time: 9:30a.m. to 5:00p.m.

Venue: Maryborough Hotel, Douglas, Cork

Duration: 3 days

Level: Intermediate

Training provider: Instil

Member subsidised fee: 700 Euro

Non-member fee: 1000 Euro

 

To Register your interest or to book a place please email Annette Coburn on skillnet@itcork.ie

Description

This course provides a complete overview of Spring as a platform for Enterprise Application Development. It is designed to teach delegates core principles of software design via their implementation in the Spring container and associated sub-projects (such as Spring MVC, Data and Boot). Both the annotation and XML based styles of development are covered, but the emphasis will be strongly on the former. The course also stresses Agile concepts via in-depth coverage of Springs support for unit and integration testing.
By the end of the delivery delegates will be able to manage Spring beans using all the features of Dependency Injection (DI) and Aspect Oriented Programming (AOP). They will have created both Web Applications and RESTful services using Spring Boot and understand how to enhance these with metrics, security and database access. In addition they will be aware of the next generation of Spring technologies, such as the Reactive Web Framework and Spring Cloud.

Prerequisites

Delegates should be confident Java programmers who have at least a basic knowledge of the technologies involved in Web Apps and Databases (HTTP, HTML, XML, CSS, JSON, REST and SQL).
Modules

Introduction to Dependency Injection

  • How encapsulated dependencies lead to a ‘ball of mud’
  • Introducing the OO principle of Dependency Injection
  • Injecting dependencies via constructor arguments
  • Injecting dependencies via JavaBean properties
  • Injecting dependencies via the Reflection API
  • Pros and cons of adopting a DI container
  • Popular DI containers in Java (inc. CDI)

 

Introduction to Spring

  • Weaknesses in the original JEE architecture
  • How JEE originally ignored Dependency Injection
  • Why Spring arose as a cure for the maladies of JEE
  • Configuring Spring via XML, Groovy and annotations
  • How to choose between the configuration options
  • Springs growth from library to framework to ecosystem
  • Choosing between the Spring platform and JEE8

 

Annotation Based Dependency Injection in Spring

  • Configuring a Spring project to use annotation based injection
  • Understanding scopes and selecting the correct scope for a bean
  • Using @Autowired to perform autowiring by type
  • Using @Autowired and @Qualifier for autowiring by name
  • Using @Resource as an alternative means of autowiring by name
  • Declaring beans using @Component, @Service and @Controller
  • Creating bean providers with @Configuration from Spring 3 onwards
  • A detailed introduction to Spring Expression Language (Spring EL)
  • Populating fields via Spring EL using @Value

 

XML Based Dependency Injection in Spring (Overview Only)

  • Pros and cons of XML DI over annotations
  • Reading bean definitions from an XML file
  • Choosing between singleton and prototype scope
  • Configuring beans via constructor arguments
  • Configuring beans via JavaBean properties
  • Injecting lists and other types of collection
  • Nesting bean definitions and using auto-wiring
  • Using inheritance to simplify bean definitions
  • Using Spring EL to simplify and extend config files

Testing Spring Code Part One

  • How a DI container aids unit and integration testing
  • Configuring the Spring specific test runner for JUnit
  • Injecting dependencies into JUnit tests via Spring
  • Creating configurations for different testing scenarios
  • Combining mocking frameworks like Mockito with Spring

AOP Support Within Spring

  • The notion of cross-cutting concerns (aka Aspects)
  • Key terms (Aspects, Advice, Pointcuts, Weaving etc…)
  • Why weaving is the biggest obstacle to adopting AOP
  • Support for AOP in Spring Core via auto-proxying
  • Why only method calls can be intercepted in Spring
  • Declaring Advice and Pointcuts using annotations
  • Understanding the five different kinds of advice
  • How AOP is used within Spring Security and Transactions

 

Introduction to Spring MVC and Boot

  • The evolution of Spring MVC and Spring Boot
  • The Dispatcher Servlet, Handler Mappings and View Resolvers
  • Registering controllers via annotations and component scanning
  • The difference between @Controller and @RestController
  • Creating a Spring MVC application without assistance
  • Creating MVC apps via Spring Boot and the Initializr

 

Working with Spring MVC Controllers

  • Mapping URL’s and HTTP verbs to controller methods
  • Using @RequestParam to inject individual parameters
  • Using @PathVariable to inject information from the URL
  • Injecting information from HTTP headers and cookies
  • Forwarding the request to a view page in Web Applications
  • Marshalling different content types in RESTful services
  • Managing headers and response codes using ResponseEntity
  • Populating a JavaBean with multiple parameters from the request
  • Validating input using Springs support for JSR-303
  • Configuring exception resolvers for unhandled errors

 

Testing Spring Code Part Two

  • The spring-test module and TestContext framework
  • Creating a Web Application Context within a JUnit test
  • Sending requests to controllers via the Dispatcher Servlet
  • Using the fluent API to specify requests and check responses
  • Built in types for mocking out components from the Servlet API
  • Running tests within the context of a Spring managed transaction
  • Committing and rolling back transactions via annotations and in code
  • Executing SQL scripts and verifying changes to the state of the database
  • Options for extending the TestContext framework in large projects

 

Advanced Concepts in Spring MVC

  • Managing Cross-Origin Resource Sharing (CORS)
  • Monitoring your services via Spring Boot Actuator
  • Options for securing your Web App via Spring Security
  • Creating Reactive Services in Spring 5 via Spring Cloud

 

Database Integration in Spring

  • How Spring facilitates Enterprise Integration
  • Configuring and using Hibernate directly from Spring code
  • Working with Hibernate indirectly via the Persistence API (JPA)
  • Encapsulating database access code via the Respository Pattern
  • Using Spring Data to generate repository objects for you
  • Combining Spring Data with Spring Boot and Spring MVC
  • Options for customizing Spring Data repositories

To register your interest or to book a place please email Annette Coburn on skillnet@itcork.ie