Spring Framework: Hibernate, Spring MVC и REST

Траян Илиев - Certified Java SE 6 ProgrammerOracle® Certified Professional - Java SE 6 Programmer
Тренингът се води от Траян Илиев, Oracle® сертифициран Java програмист с 15 годишен опит, разработчик на end-to-end reactive fullstack приложения с ES6/7, TypeScript, Angular, React и Vue, 12+ години опит като IT трейнър за международни софтуерни компании. Има множество презентации на Voxxed Days, jPrime, jProfessionals, BGOUG, BGJUG, DEV.BG на теми като SOA & REST (JAX-RS, Microservices), Spring 5 и Spring Reactor, Java EE 7, CDI, Angular, React, Redux, high-performance Java programming.


Целева аудитория: Medium to expert level Java developers with practical experience building server-side and web applications.

Продължителност: 50 часа

Цена: 560 лева

Описание на курса:The course introduces to enterprise SOA & web application development using Spring 5 platform. The main topics include:

  1. Introduction to Spring – evolution of Spring framework, main features. Introduction to Maven and Gradle. Building a HelloSpring application using XML and annotation-based configurations. (2 h)
  2. Inversion of Control (IoC) and Dependency Injection (DI) in Spring– lookup vs. injection, constructor, setter and field-based DI. Instantiating the container. Beans and BeanFactory implementations. Configuring ApplicationContext – basic configuration, classpath scanning and filters, component declaring meta-annotations. XML-based configuration using GenericXmlApplicationContext. Java annotations configuration (@Bean, @Configuration, @ComponentScan) – AnnotationConfigApplicationContext. Mixing XML & Java – @Import, @ImportResource. Instantiating beans using constructor and static/instance factory methods. Dependency resolution process. Dependencies and configuration in detail – values, bean references, inner beans, collections, maps, null handling, p- and c-namespaces, compound property names, depends-on, lazy initialization, autowiring. Excluding a bean from autowiring. Limitations and disadvantages of autowiring. Method and lookup method injection. (4 h)
  3. Inversion of Control (IoC) and Dependency Injection (DI) in Spring (Advanced)– Bean scopes – singleton, request, session, application, websocket, and custom scopes. Web configuration. Scoped beans as dependencies – <aop:scoped-proxy>. Lifecycle callbacks – initialization, destruction, @PostConstruct, @PreDestroy. ApplicationContextAware, BeanNameAware, **Aware interfaces. Bean definition inheritance. Container Extension Points. Using Spring resource injection annotations – @Autowired, @Component, @Scope, @Value, @Required, @Qualifier, @Lazy, @Primary. Using JSR 330 standard annotations – @Resource, @Inject, @Named, @ManagedBean, @Qualifier, @Alternative. Environment and profiles, @PropertySource. I18N using MessageSource. Events and event listeners – @EventListener, @Order, @Async. The Groovy bean definition DSL. (4 h)
  4. Resources and resource loaders. Validation, data binding, and type conversion. JSR-349 Bean Validation 1.1. Spring’s Validator interface. Resolving codes to error messages. Bean manipulation using BeanWrapper. PropertyEditors and type conversion. Null-safety annotations. (2 h)
  5. Spring Expression Language (SpEL). Aspect Oriented Programming (AOP) with Spring. AOP concepts – aspect, advice, joint point, pointcut, introduction, target object, AOP proxy. Types of advices. Dynamic proxies. @AspectJ and schema-based AOP support. Declaring pointcuts. Advisors – examples: declarative transactions, retrying operation execution. Spring AOP APIs. Using the ProxyFactoryBean to create AOP proxies. Creating AOP proxies programmatically with the ProxyFactory. Autoproxy bean definitions. Target sources – swapping, pooling, ThreadLocal. Custom advises. (4 h)
  6. Spring JDBC Support – DAO pattern, simple relational DB example, Spring JDBC Infrastructure, database Connections and DataSources, embedded database support, exception handling. JdbcTemplate class. Retrieving nested entities with ResultSetExtractor. Spring classes modelling main JDBC operations. Inserting data and retrieving the generated key. Batching operations. Calling stored procedures/functions. Spring Data project – JDBC extensions. Spring Boot starter JDBC. (4 h)
  7. Object to Relational Mapping (ORM). Using Hibernate with SpringHibernate API vs. Java Persistence API (JPA). Important ORM concepts using Hibernate. Configuring the Hibernate SessionFactory. ORM mapping using Hibernate annotations. Hibernate Session interface – querying, inserting, updating and deleting data. Annotating fields or properties. Spring Data access using JPA 2.1 – ORM mapping using JPA annotations, database operations using JPA Repository abstraction, custom queries. Tracking entity changes using Auditable interface or annotations. Tracking entity versions using Hibernate Envers. Spring Boot starter data JPA. Validation using Beans Validation 1.1 annotations. Considerations choosing the right data management approach. (6 h)
  8. Transaction management – transaction types, PlatformTransactionManager, TransactionDefinition and TransactionStatus interfaces, AOP-based transaction management configuration. Using programmatic transactions. Using global Java Transaction API (JTA) transactions with Spring. Considerations choosing the right type of transaction management. (2 h)
  9. Using Spring Remoting – Spring HTTP invoker, JMS with Spring, AMQP with RabbitMQ. Building custom service with JPA, Hibernate and Spring Web MVC – @EnableWebMvc, WebMvcConfigurer and WebApplicationInitializer interfaces. Exposing the service using HTTP invoker. Testing the service using HttpInvokerProxyFactoryBean client. Using Java Messaging Service (JMS) with HornetQ – basic concepts and patterns, queues and topics, HornetQ JMS ConnectionFactory configuration. Implementing a JMS Listener in Spring – @JmsListener, onMessage. Sending JMS Messages. JMS with Spring Boot Artemis starter. Remoting using AMQP in Spring with RabbitMQ. Using AMQP with Spring Boot. (6 h)
  10. Building RESTful Web Services with Spring – introduction to SOA, REST and HATEOAS, levels of maturity of web applications, resources and sub-resources, URI templates. Using Spring WebMVC to expose RESTful web services – @Controller, @RequestMapping, @ResponseBody, @RestController. Configuring JSON/XML data binding. Configuring Spring web application. Using curl client to test the REST service. Building dedicated Spring client using RestTemplate. Securing RESTful web service with Spring Security – @EnableWebSecurity, WebSecurityConfigurerAdapter, HttpSecurity, AuthenticationManagerBuilder. RESTful web services with Spring Boot. (4 h)
  11. Spring applications monitoring and testing – unit, integration, front-end (end-to-end), and performance testing. Using Spring Test annotations. Unit testing Spring components using Junit 5 Jupiter and Mockito. Integration testing – configuring service-layer testing profile, implementing TestExecutionListener interface. End-to-end testing using Selenium. Using VisualVM for JMX monitoring, Hibernate statistics. Using JMX with Spring Boot. (6 h)
  1. Building web applications with Spring Web MVC – implementing multi-layer web applications including DAO, service and presentation layers. Spring MVC architecture – requests life-cycle, responding to normal HTTP and Ajax requests, WebApplicationContext hierarchy, main components – handlers, handler interceptors, error and view resolvers, configuration. Spring integration with different view technologies JSP, Thymeleaf, Velocity, FreeMarker, iText PDF. Enabling internationalization and localization. Using theming and templating. Implementing views with JSP(X) and Thymeleaf. Dynamic JavaScript clients using JQuery. Enabling data pagination on the server side. Handling file uploads. Securing web apps with Spring Security. Building web apps with Spring Boot. Using WebSocket API with Spring and SockJS and STOMP. (6 h)

The course contains 50% presentations and demonstrations, and 50% lab exercises, conducted in parallel to achieve immediate reinforcement of concepts in practice.

Participants will learn how to build Spring web apps and services with Hibernate, Spring Web MVC, and REST. Study is conducted in small groups – up to 10 persons. During the course there will be opportunity for discussion of additional questions the participants are interested in.
. pdf Viewing detailed program of the course in PDF format (in a new browser window) For more information and registration, please send us an e-mail at: office@iproduct.org