万本电子书0元读

万本电子书0元读

顶部广告

Spring 5 Design Patterns电子书

售       价:¥

31人正在读 | 0人评论 6.2

作       者:Dinesh Rajput

出  版  社:Packt Publishing

出版时间:2017-10-06

字       数:51.0万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Learn various design patterns and best practices in Spring 5 and use them to solve common design problems. About This Book ? Explore best practices for designing an application ? Manage your code easily with Spring's Dependency Injection pattern ? Understand the benefits that the right design patterns can offer your toolkit Who This Book Is For This book is for developers who would like to use design patterns to address common problems while designing an app using the Spring Framework and Reactive Programming approach. A basic knowledge of the Spring Framework and Java is assumed. What You Will Learn ? Develop applications using dependency injection patterns ? Learn best practices to design enterprise applications ? Explore Aspect-Oriented Programming relating to transactions, security, and caching. ? Build web applications using traditional Spring MVC patterns ? Learn to configure Spring using XML, annotations, and Java. ? Implement caching to improve application performance. ? Understand concurrency and handle multiple connections inside a web server. ? Utilizing Reactive Programming Pattern to build Reactive web applications. In Detail Design patterns help speed up the development process by offering well tested and proven solutions to common problems. These patterns coupled with the Spring framework offer tremendous improvements in the development process. The book begins with an overview of Spring Framework 5.0 and design patterns. You will understand the Dependency Injection pattern, which is the main principle behind the decoupling process that Spring performs, thus making it easier to manage your code. You will learn how GoF patterns can be used in Application Design. You will then learn to use Proxy patterns in Aspect Oriented Programming and remoting. Moving on, you will understand the JDBC template patterns and their use in abstracting database access. Then, you will be introduced to MVC patterns to build Reactive web applications. Finally, you will move on to more advanced topics such as Reactive streams and Concurrency. At the end of this book, you will be well equipped to develop efficient enterprise applications using Spring 5 with common design patterns Style and approach The book takes a pragmatic approach, showing various design patterns and best-practice considerations, including the Reactive programming approach with the Spring 5 Framework and ways to solve common development and design problems for enterprise applications.
目录展开

Title Page

Copyright

Spring 5 Design Patterns

Credits

About the Author

About the Reviewer

www.PacktPub.com

Why subscribe?

Customer Feedback

Dedication

Preface

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the example code

Errata

Piracy

Questions

Getting Started with Spring Framework 5.0 and Design Patterns

Introducing Spring Framework

Simplifying application development using Spring and its pattern

Using the power of the POJO pattern

Injecting dependencies between POJOs

How DI works and makes things easy for development and testing

Using factory helper pattern for dependent components

Using DI pattern for dependent components

Applying aspects for cross cutting concerns

How Spring AOP works

Applying the template pattern to eliminate boilerplate code

The Template Design pattern in Spring

Using a Spring container to manage beans with the Factory pattern

Bean factory

Application contexts

Creating a container with an application context

Life of a bean in the container

Spring modules

Core Spring container

Spring's AOP module

Spring DAO - data access and integration

Spring's ORM

Spring web MVC

New features in Spring Framework 5.0

Summary

Overview of GOF Design Patterns - Core Design Patterns

Introducing the power of design patterns

Common GoF Design Pattern overview

Creational design patterns

Factory design pattern

Implementing the Factory design pattern in Spring Framework

Sample implementation of the Factory design pattern

Abstract factory design pattern

Common problems where you should apply the Abstract factory design pattern

Implementing the Abstract factory design pattern in the Spring Framework

Sample implementation of the Abstract Factory design pattern

Singleton design pattern

Common problems where you should apply Singleton pattern

Singleton design pattern implementation in the Spring Framework

Sample implementation of the Singleton design pattern

Prototype design pattern

Benefits of the Prototype design pattern

UML class structure

Sample implementation of the Prototype design pattern

Builder design pattern

Benefits of the Builder pattern:

UML class structure

Implementing the Builder pattern in the Spring Framework

Common problems where you should apply Builder pattern

Sample implementation of the Builder design pattern

Summary

Consideration of Structural and Behavioral Patterns

Examining the core design patterns

Structural design patterns

The adapter design pattern

Benefits of the adapter pattern

Common requirements for the adapter pattern

Implementation of the adapter design pattern in the Spring Framework

Sample implementation of the adapter design pattern

The Bridge design pattern

Benefits of the Bridge pattern

Common problems solved by the Bridge design pattern

Implementing the Bridge design pattern in the Spring Framework

Sample implementation of the Bridge design pattern

Composite design pattern

Common problems solved by the composite pattern

UML structure of the Composite design pattern

Sample implementation of the Composite design pattern

Decorator design pattern

Common problems solved by the Decorator pattern

Implementing the Decorator pattern

Decorator design pattern in the Spring Framework

Facade Design Pattern

Knowing when to use the Facade Pattern

Implementing the Facade design pattern

The UML structure for the Facade design pattern

Facade Pattern in the Spring Framework

Proxy design pattern

Purpose of the Proxy pattern

UML structure for the Proxy design pattern

Implementing the Proxy design pattern

Proxy pattern in the Spring Framework

Behavioral design patterns

Chain of Responsibility design pattern

Chain of Responsibility pattern in the Spring Framework

Command design pattern

Command design pattern in the Spring Framework

Interpreter Design pattern

Interpreter design pattern in the Spring Framework

Iterator Design Pattern

Iterator design pattern in the Spring Framework

Observer pattern in the Spring Framework

Template Design Pattern

JEE design patterns

Summary

Wiring Beans using the Dependency Injection Pattern

The dependency injection pattern

Solving problems using the dependencies injection pattern

Without dependency injection

With dependency injection pattern

Types of dependency injection patterns

Constructor-based dependency injection pattern

Setter-based dependency injection

Configuring the dependency injection pattern with Spring

Dependency injection pattern with Java-based configuration

Creating a Java configuration class - AppConfig.java

Declaring Spring beans into configuration class

Injecting Spring beans

Best approach to configure the dependency injection pattern with Java

Dependency injection pattern with XML-based configuration

Creating an XML configuration file

Declaring Spring beans in an XML file

Injecting Spring beans

Using constructor injection

Using setter injection

Dependency injection pattern with Annotation-based configuration

What are Stereotype annotations?

Creating auto searchable beans using Stereotype annotations

Searching beans using component scanning

Annotating beans for autowiring

Using @Autowired with setter method

Using @Autowired with the fields

The Autowiring DI pattern and disambiguation

Resolving disambiguation in Autowiring DI pattern

Implementing the Abstract Factory Pattern in Spring (FactoryBean interface)

Implementation of FactoryBean interface in Spring

Sample implementation of FactoryBean interface

Best practices for configuring the DI pattern

Summary

Understanding the Bean Life Cycle and Used Patterns

The Spring bean life cycle and its phases

The initialization phase

Creating the application context from configuration

Load bean definitions

Initializing bean instances

Customizing beans using a BeanPostProcessor

The Initializer extension point

The Use phase of beans

Implementing the Decorator and Proxy patterns in Spring using Proxies

The destruction phase of the beans

Understanding bean scopes

The singleton bean scope

The prototype bean scope

The session bean scope

The request bean scope

Other scopes in Spring

Custom scopes

Creating custom scopes

Summary

Spring Aspect Oriented Programming with Proxy and Decorator pattern

Proxy pattern in Spring

Proxying classes using Decorator pattern in Spring

What are cross-cutting concerns?

What is Aspect-Oriented Programming?

Problems resolved by AOP

Code tangling

Code scattering

How AOP Works to solve problems

Core AOP terminology and concepts

Advice

Join Point

Pointcut

Aspect

Weaving

Defining pointcuts

Writing pointcuts

Creating aspects

Define aspects using Annotation

Implementing Advice

Advice type - Before

Before Advice example

Advice Types: After Returning

After Returning Advice example

Advice Types: After Throwing

After Throwing Advice example

Advice Types: After

After Advice example

Advice Types - Around

Around Advice example

Define aspects using XML configuration

Understanding AOP proxies

Summary

Accessing a Database with Spring and JDBC Template Patterns

The best approach to designing your data-access

The resource management problem

Implementing the template design pattern

Problems with the traditional JDBC

Solving problems with Spring's JdbcTemplate

Configuring the data source and object pool pattern

Configuring a data source using a JDBC driver

Configuring the data source using pool connections

Implementing the Builder pattern to create an embedded data source

Abstracting database access using the DAO pattern

The DAO pattern with the Spring Framework

Working with JdbcTemplate

When to use JdbcTemplate

Creating a JdbcTemplate in an application

Implementing a JDBC-based repository

Jdbc callback interfaces

Creating a RowMapper class

Implementing RowCallbackHandler

Implementing ResultSetExtractor

Best practices for Jdbc and configuring JdbcTemplate

Summary

Accessing Database with Spring ORM and Transactions Implementing Patterns

ORM Framework and the patterns used

Resource and transaction management

Consistent exception handling and translation

The data access object pattern

Creating DAOs using the Factory design pattern in Spring

The Data Mapper pattern

The domain model pattern

Proxy for the lazy loading pattern

Spring's Hibernate template pattern

Integrating Hibernate with Spring

Configuring Hibernate's SessionFactory in a Spring container

Implementing DAOs based on the plain Hibernate API

Transaction management strategies in Spring

Declarative transaction demarcation and implementation

Deploying the transaction manager

Step 1 - Implementing the transaction manager

Step 2 - Declaring the transaction demarcation

Programmatic transaction demarcation and implementation

Best practices for Spring ORM and transaction module in an application

Summary

Improving Application Performance Using Caching Patterns

What is cache?

Where do we use caching?

Understanding cache abstraction

Enabling caching via the Proxy pattern

Enabling the caching proxy using Annotation

Enabling the Caching Proxy using the XML namespace

Declarative Annotation-based caching

The @Cacheable annotation

The @CachePut annotation

Customizing the cache key

Conditional caching

The @CacheEvict annotation

The @Caching annotation

The @CacheConfig annotation

Declarative XML-based caching

Configuring the cache storage

Setting up the CacheManager

Third-party cache implementations

Ehcache-based cache

XML-based configuration

Creating custom caching annotations

Top caching best practices to be used in a web application

Summary

Implementing the MVC Pattern in a Web Application using Spring

Implementing the MVC pattern in a web application

Model 2 architecture MVC pattern with Spring

The Front Controller design pattern

Processing the life of a request

Configuring DispatcherServlet as the Front Controller

Defined by XML configuration

Defined by Java configuration

Enabling the Spring MVC

Implementing controllers

Defining a controller with @Controller

Mapping requests with @RequestMapping

@RequestMapping at method level

@RequestMapping at the class level

Defining @RequestMapping handler methods

Passing model data to the view

Accepting request parameters

Taking query parameters

Taking request parameters via path variables

Processing forms of a web page

Implementing a form handling controller

Data binding with Command Design pattern

Using @ModelAttributes for customizing data binding

Validating forms input parameters

Implementing View in the MVC pattern

Defining ViewResolver in the Spring MVC

Implement the View

Register ViewResolver with Spring MVC

The View Helper pattern

Composite View pattern using Apache tile view resolver

Configuring a Tiles ViewResolver

Best practices for web application design

Summary

Implementing Reactive Design Patterns

Understanding application requirement over the years

Understanding the reactive pattern

The reactive pattern traits

Responsiveness

Resilience

Scalable

Message-driven architecture

Blocking calls

Non-blocking calls

Back-pressure

Implementing reactive with the Spring 5 Framework

Reactive Streams

Spring Web reactive module

Implementing a reactive web application at the server side

The Annotation-based programming model

The functional programming model

Implementing a Reactive Client-Side application

Request and response body conversion

Summary

Implementing Concurrency Patterns

Active object pattern

Monitor object pattern

Half-Sync/Half-Async patterns

Leader/follower pattern

Reactor pattern

Thread-specific storage pattern

Best practices for concurrency module

Summary

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部