: Seth Ladd, Bram Smeets
: Building Spring 2 Enterprise Applications
: Apress
: 9781430205005
: 1
: CHF 36.20
:
: Informatik
: English
: 335
: Wasserzeichen/DRM
: PC/MAC/eReader/Tablet
: PDF

This is a brilliantly practical work that lets the reader experience a real-world scalable agile enterprise Java-based application being built from the ground up using the latest Spring 2.x kit available. The open source agile lightweight Spring (meta) Framework 2.x is by far the leading innovative force and 'lightning rod' that's driving today's Java industry. Spring has time and time again proven itself in real-world highly scalable enterprise settings such as banks and other financial institutions. This book is the only authoritative Spring 2 authored book, as it has been written by team members of Interface21, the group that lead the Spring Foundation and its growing community.



Seth Ladd is a software engineer and professional Spring Framework trainer and mentor specializing in object-oriented and testable web applications. He started his own company building websites at age 17, but now enjoys having a real job. Currently working for Camber Corporation, Seth has built and deployed systems for NEC, Rochester Institute of Technology, Brivo Systems, and National Information Consortium. He has architected and developed enterprise applications in Java and C for both the server and remotely connected embedded devices. He enjoys speaking and teaching, and is a frequent presenter at local Java user groups and at corporate developer conferences. Seth is very thankful for living and working in Kailua, Hawaii, with his wife.
Contents at a Glance4
Contents5
Introduction11
Who This Book Is For11
How This Book Is Structured12
Prerequisites12
Downloading the Code13
CHAPTER 1 A Gentle Introduction to the Spring Framework14
Building a Business Application14
Java Platform Hurdles15
Enter the Spring Framework15
Introducing the Spring Framework Modules15
Introducing the Sample Application17
Managing Dependencies in Applications18
A Use Case That Has Dependencies18
Dealing with the Dependencies in Plain Java22
Looking Up Dependencies with JNDI24
Using the Spring Framework to Provide Dependencies25
Integrating the Spring Framework with Java EE32
Spring Framework Integration with Java EE Technologies32
Spring and EJB33
Setting Up the Spring Framework in Your Applications34
Summary35
CHAPTER 2 The Core Container36
How Do Factories Work?36
Factory Methods37
Factory Objects37
Introducing the BeanFactory38
Creating a BeanFactory Object39
Using Dependency Lookup40
Using Dependency Injection40
Using XML Tags for Bean Configuration53
Examining the Bean Life Cycle56
Bean Scope: Singleton or Prototype56
Bean Initialization61
Bean Destruction64
Using Factory Methods and Factory Objects in the Container67
Implementing Factory Methods67
Implementing Factory Objects69
Implementing Factory Objects with the FactoryBean Interface70
Introducing the ApplicationContext71
Representing Resources71
Creating ApplicationContext Objects72
Configuring the Container with Spring 2.0 XML Tags75
Using the Container As a Deployment Model76
Summary76
CHAPTER 3 Aspect-Oriented Programming77
Extending Applications the Traditional Way77
Extending a Base Class78
Using the Observer Design Pattern79
Using the Decorator Design Pattern81
Benefits of Separating Concerns84
Limitations of Object-Oriented Solutions85
Enter AOP85
The Classic Spring AOP Framework86
Implementing Cross-Cutting Concerns86
Configuring AOP in the Spring Container87
Using Proxy Objects88
Filtering Methods89
Selecting Advice Types92
AOP Usage in the Spring Framework99
Other Advice Classes99
Logging Messages with Around Advice99
Debugging with Around Advice100
Limiting Concurrent Method Execution with Around Advice100
Summary101
CHAPTER 4 Spring AOP 2.0102
Introducing AspectJ and Aspects102
Join Points and Pointcuts in AspectJ103
AspectJ Aspect Creation104
Configuring @AspectJ-Style Aspects in Spring105
A Simple @AspectJ-Style Aspect105
@AspectJ-Style Advice Types109
Pointcut Declaration and Reuse113
Auto-Proxy Creation in the Spring Container114
Advice and Aspect Ordering115
Using AOP XML Tags119
AOP Configuration Tags119
XML Aspect Configuration120
Pointcut Declaration and Reuse with XML123
Advice Declaration in XML124
Advice Ordering in XML128
Advisors with AspectJ Pointcuts128
Proxy Type Selection in XML129
Working with Pointcuts130
Selecting Methods Directly131
Selecting Methods via Classes, Packages, and Inheritance135
Selecting Methods via Annotations136
Binding Advice Arguments141
Binding Method Argument Values143
Binding Return Values144
Binding Exceptions145
Binding Annotations146
Summary149
CHAPTER 5 Introduction to Data Access150
Spring Integration with Data-Access Frameworks150
The Challenges of Data Access151
Effects of Data-Access Leakage152
Database Resources155
Exceptions Related to Data Access162
Database Transactions163
Abstractions164
The Spring Solutions to Data Access165
Managing Database Resources166
Handling Data-Access Exceptions167
Working with Database Transactions167
Data-Access Leakage169
Changing the Application169
Abstractions for Data-Access Code170
Using the Repository Adapter172
The DataSource Interface and Connection Pools174
Setting Up Connection Pools175
Using Value Placeholders and Property Files176
Summary177
CHAPTER 6 Persistence with JDBC178
Defining the Data Layer178
Using the JdbcTemplate Class180
Using the JdbcDaoSupport Class183
Working with Database Data184
Using Callbacks187
Using the RowMapper Interface188
Using the PreparedStatementSetter Interface189
Using Executable Query Objects190
Using the MappingSqlQuery Class190
Using the SqlUpdate Class192
Using the StoredProcedure Class194
Creating Batches195
Working with LOBs196
Using the NativeJdbcExtractor Interface197
Introducing New Spring 2.0 Features199
Using the SimpleJdbcTemplate Class199
Performing JNDI Data Source Lookups200
Summary201
CHAPTER 7 Transaction Management202
Database Transactions202
Transaction Management in Spring203
Configuring Spring s Transaction Manager for JDBC205
Conf