Building Spring 2 Enterprise Applications - Introduction

3 295 0
Building Spring 2 Enterprise Applications - Introduction

Đang tải... (xem toàn văn)

Thông tin tài liệu

Introduction T his book covers the Spring Framework, the Java application framework of choice for tens of thousands of Java developers worldwide. We feel it is important to introduce you to the Spring Framework by showing you how to use it. So we wrote a book that uses a complex sample applica- tion to demonstrate how the Spring Framework is used in a typical business application. By exploring the code from the sample application, presented throughout this book, you will benefit from many insights in application development. This is important knowledge for any developer, no matter how many years of experience you have. Ultimately, the goal of this book is to make you, the reader, more efficient as a Java developer by taking the things that are good about the Java platform and using them in the most efficient and reliable way. In this book, we focus on how to be successful in two areas that are important in software development: simplicity and consistency. Both goals can be achieved with the Spring Framework, although creating a simple design requires effort from your side as well. The concept of API consistency involves applying the same design and coding pattern where applicable. Clients of a consistent API feel at home when using it, and are able to concentrate on its logic instead of its semantics. The Spring Framework excels at bringing consistency to the Java plat- form. We’re going to show you how to leverage this consistency to make your applications more consistent. Simplicity in software development means four things: • To implement only the functionality that is absolutely required and nothing more • To write code that is as clean, readable, and simple as possible • To write code that is easy to test and is tested only once • To streamline the development process cycle to be as agile and rapid as possible (taking into account the settings of your projects) The Spring Framework enables you to implement your applications in a simple way, but it does not stop you from writing overly complex software that is hard to test and doesn’t deliver what is expected. This book will guide you in achieving simplicity in your code and show you how the Spring Framework helps to write simple code that is easy to test. Who This Book Is For This book is intended for Java developers who want to use the Spring Framework in their applica- tions. You will learn not only what features the Spring Framework offers, but also when to use them and how to use them correctly. xi 9187FM.qxd 8/2/07 4:18 PM Page xi How This Book Is Structured This book is divided into ten chapters: Chapter 1 introduces the Spring Framework and its core values. In this chapter, we will discuss the modules of the Spring Framework, introduce the sample application, and use the Spring Framework to solve an important problem that many applications face. This chapter also examines Spring’s relationship with Java Enterprise Edition and Enterprise JavaBeans. Chapter 2 details the core deployment model of the Spring Framework that you can use to configure and deploy your applications. It’s the perfect start to bring consistency to your appli- cations. Once you know how this deployment model works, you can reuse it every time you need to configure objects. Chapter 3 explains how to reuse the most efficient and flexible solution to a problem every- where you need it. The technical term for a solution that is required in multiple places is a cross-cutting concern. This chapter introduces Spring’s aspect-oriented programming (AOP) framework. Chapter 4 builds on the theme of AOP and shows how Spring 2.0 makes AOP more consistent and simpler to use. Chapter 5 describes how data access—also called persistence—is simplified and made consis- tent by the Spring Framework. If you handle data access correctly, it will improve the simplicity of your applications significantly, and Chapter 5 explains how to do that. Chapter 6 discusses the data-access layer of the sample application, which is implemented using Spring’s JDBC framework. Chapter 7 shows you how to move transaction management out of your application code by using Spring’s transaction management framework. Chapter 8 introduces Spring’s web framework and discusses how the web layer of the sample application is implemented. Chapter 9 demonstrates different ways of returning content to the browser window. This chap- ter also explores how to create and return Adobe PDF and Microsoft Excel files to the browser with ease. Chapter 10 shows you how to do less work during development projects by testing applications before you write code. In economics, the standard way to reduce costs is to do less work and deliver to customers only what they really want, and nothing more. This chapter translates this principle to application development. This book shows how the Spring Framework can make you more efficient as a developer and as a team member. The final chapter brings everything together and explains how you can start chang- ing your development process so that you not only develop more efficient code, but also shorten the development life cycle. Prerequisites We assume that you have a good understanding of the Java programming language, preferably version 1.4 or later. For the first four chapters of this book and in Chapter 10, you are expected to understand classes, objects, inheritance, exception handling, and threads in Java. For Chapters 5 to 7, you are expected to have a basic understanding of JDBC, relational data- bases, the SQL query language, and database transactions. ■ INTRODUCTIONxii 9187FM.qxd 8/2/07 4:18 PM Page xii For Chapter 8, you are expected to have a basic understanding of HTML, JSP, and servlet con- tainers such as Tomcat. Chapter 9 discusses specific frameworks with which the Spring Framework integrates. If you are not familiar with any of these frameworks, but wish to use them, you are encouraged to first gain a basic understanding of how they work, and then return to this chapter to learn how to use them in combination with the Spring Framework. Downloading the Code The source code for this book is available to readers from the Apress website (http://www.apress. com), in the Source Code/Download section. Please feel free to visit the Apress website and down- load all the code there. You can also check for errata and find related titles from Apress. ■ INTRODUCTION xiii 9187FM.qxd 8/2/07 4:18 PM Page xiii . use the Spring Framework to solve an important problem that many applications face. This chapter also examines Spring s relationship with Java Enterprise. Edition and Enterprise JavaBeans. Chapter 2 details the core deployment model of the Spring Framework that you can use to configure and deploy your applications.

Ngày đăng: 05/10/2013, 05:20

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan