logo资料库

Expert One On One J2EE Development Without EJB.pdf(英文版)

第1页 / 共578页
第2页 / 共578页
第3页 / 共578页
第4页 / 共578页
第5页 / 共578页
第6页 / 共578页
第7页 / 共578页
第8页 / 共578页
资料共578页,剩余部分请下载后查看
TeamLiB
Cover
About the Authors
Contents
Introduction
Who This Book Is For
Aims of This Book
What This Book Covers
Assumed Knowledge
Recommended Reading
What You Need to Use This Book
The Sample Application
Conventions
Errata
p2p. wrox. com
Chapter 1: Why " J2EE Without EJB"?
EJB Under the Spotlight
What's Left of J2EE?
J2EE at a Crossroads
The Way Forward
Should We Ever Use EJB?
Summary
Chapter 2: Goals
Productivity
OO
The Importance of Business Requirements
The Importance of an Empirical Process
Summary
Chapter 3: Architectures
Architectural Building Blocks
J2EE Architectures
J2EE Architectures in Practice
Deciding Whether an Application Needs an Application Server
Summary
Chapter 4: The Simplicity Dividend
The Cost of Complexity
Causes of Complexity in J2EE Applications
How Much Complexity Is too Much Complexity?
Summary
Chapter 5: EJB, Five Years On
Hype and Experience
An Aging Component Model
What Do We Really Want from EJB, or Why Stateless Session Beans Are So Popular
What Don't We Want from EJB?
Can EJB Reinvent Itself?
Myths and Fallacies
Moving Forward
Summary
Chapter 6: Lightweight Containers and Inversion of Control
Lightweight Containers
Managing Business Objects
Inversion of Control
Implications for Coding Style, Testing, and Development Process
Applying Enterprise Services
Summary
Chapter 7: Introducing the Spring Framework
History and Motivation
A Layered Application Framework
The Core Bean Factory
Resource Setup
The Spring Application Context
Summary
Chapter 8: Declarative Middleware Using AOP Concepts
AOP 101
EJB as a Subset of AOP
AOP Implementation Strategies
AOP Implementations
AOP Design Issues
J2EE a la carte
AOP in Practice with Spring
Using Source-level Metadata to Provide an Abstraction above AOP
Implications for Programming Style
References
Summary
Chapter 9: Transaction Management
High-level Transaction Management
Classic J2EE Transaction Management
Lightweight Transaction Infrastructure
Transaction Management with the Spring Framework
Summary
Chapter 10: Persistence
Common Persistence Strategies
A Brief History of Java Persistence Technologies
Data Access Technologies in Practice
The Data Access Object Pattern
Data Access with the Spring Framework
Summary
Chapter 11: Remoting
Classic J2SE Remoting: RMI
Classic J2EE Remoting: EJB
WSDL-based Web Services: JAX-RPC
Lightweight Remoting: Hessian and Burlap
Summary
Chapter 12: Replacing Other EJB Services
Thread Management
EJB Instance Pooling
Alternatives to EJB Threading and Pooling
Declarative Security
JMS and Message-driven Beans
Summary
Chapter 13: Web Tier Design
Goals and Architectural Issues
Request-driven Web MVC Frameworks
Alternative Approaches to Web MVC
Summary
Chapter 14: Unit Testing and Testability
Why Testing Matters
Goals of Unit Testing
Ensuring Testability
Unit Testing Techniques
Test-driven Development ( TDD)
Case Study: The Spring Experience
Testing Spring Applications
Coverage Analysis and Other Test Tools
Resources
Summary
Chapter 15: Performance and Scalability
Definitions
Setting Clear Goals
Architectural Choices: The Key to Performance and Scalability
Implementation Choices
Tuning and Deployment
An Evidence-based Approach to Performance
Resources
Summary
Chapter 16: The Sample Application
Pet Store Requirements
The iBATIS JPetStore 3.1
Spring JPetStore
Build and Deployment
Summary
Chapter 17: Conclusion
Looking Back
Moving Forward
Guidelines
Last Words
Index
remains
J2EE
Expert One-on-One™ J2EE™ Development without EJB™
Expert One-on-One™ J2EE™ Development without EJB™ Rod Johnson with Juergen Hoeller
Expert One-on-One J2EE™ Development without EJB™ Copyright © 2004 by Rod Johnson and Juergen Hoeller. All rights reserved. Published by Wiley Publishing, Inc., Indianapolis, Indiana Published simultaneously in Canada No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise, except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, without either the prior written permis- sion of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4447, E-mail: permcoordinator@wiley.com. LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CONTENTS OF THIS WORK AND SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE. NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES OR PROMOTIONAL MATERIALS. THE ADVICE AND STRATEGIES CONTAINED HEREIN MAY NOT BE SUITABLE FOR EVERY SITUATION. THIS WORK IS SOLD WITH THE UNDERSTANDING THAT THE PUBLISHER IS NOT ENGAGED IN RENDERING LEGAL, ACCOUNTING, OR OTHER PROFESSIONAL SERVICES. IF PROFESSIONAL ASSISTANCE IS REQUIRED, THE SERVICES OF A COMPETENT PROFESSIONAL PERSON SHOULD BE SOUGHT. NEITHER THE PUBLISHER NOT THE AUTHOR SHALL BE LIABLE FOR DAMAGES ARISING HERE- FROM. THE FACT THAT AN ORGANIZATION OR WEBSITE IS REFERRED TO IN THIS WORK AS A CITATION AND/OR A POTENTIAL SOURCE OF FURTHER INFORMATION DOES NOT MEAN THAT THE AUTHOR OR THE PUBLISHER ENDORSES THE INFORMATION THE ORGANIZATION OR WEBSITE MAY PROVIDE OR RECOMMENDATIONS IT MAY MAKE. FURTHER, READERS SHOULD BE AWARE THAT INTERNET WEBSITES LISTED IN THIS WORK MAY HAVE CHANGED OR DISAP- PEARED BETWEEN WHEN THIS WORK WAS WRITTEN AND WHEN IT IS READ. For general information on our other products and services please contact our Customer Care Department within the United States at (800) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002. Trademarks: Wiley, the Wiley Publishing logo, Wrox, the Wrox logo, Programmer to Programmer, Expert One-on-One, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates. J2EE and EJB are trademarks of Sun Microsystems, Inc. All other trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book. Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books. Library of Congress Cataloging-in-Publication Data Johnson, Rod, Ph.D. Expert one-on-one J2EE development without EJB / Rod Johnson, Juergen Hoeller. p. cm. Includes bibliographical references and index. ISBN 0-7645-5831-5 (paper/website) 1. Java (Computer program language) 2. Computer software—Development. I. Hoeller, Juergen, 1975– II. Title. QA76.73.J38J62 2004 005.13’3—dc22 2004005516 ISBN: 0-7645-5831-5 Printed in the United States of America 10 9 8 7 6 5 4 3 2 1
About the Authors Rod Johnson is an enterprise Java architect with extensive experience in the insurance, dot-com, and financial industries. He was the J2EE architect of one of Europe’s largest web portals, and he has worked as a consultant on a wide range of projects. Rod has an arts degree majoring in music and computer science from the University of Sydney. He obtained a Ph.D. in musicology before returning to software development. With a background in C and C++, he has been working with both Java and J2EE since their release. He is actively involved in the Java Community Process as a member of the JSR-154 (Servlet 2.4) and JDO 2.0 Expert Groups. He is the author of the best-selling Expert One-on-One J2EE Design and Development (Wrox, 2002) and has con- tributed to several other books on J2EE since 2000. Rod is prominent in the open source community as co-founder of the Spring Framework open source project (www.springframework.org), which grew out of code published with Expert One-on-One J2EE Design and Development. He speaks frequently at leading industry conferences. He is currently based in London. Rod can be contacted at expert@interface21.com. I’d like to thank my wife, Kerry, for her continuing love and support. Of those who’ve given practical help, I’m grateful for contributions from Gary Watson, Andrew Smith, and Jason Carreira for their thorough review of the entire manuscript; Alef Arendsen (reviewing and valuable performance bench- marking); Peter den Haan (thorough review of several chapters); Renaud Pawlak (rigorous review of the AOP material); and Steve Jefferson, Thomas Risberg, and Dmitriy Kopylenko (reviewing). I’m also grateful to the many developers and architects who have shared their experiences of J2EE devel- opment with me, in person and via e-mail. As always, working with Juergen has been a pleasure. Juergen Hoeller is a Senior Systems architect and Consultant at werk3AT, a company that delivers com- plex web solutions and provides J2EE-based consulting in Austria. Juergen has a masters degree in Computer Science from the University of Linz, specializing in Java, OO modeling, and software engineering. He has worked on a wide range of projects with numerous J2EE application servers, ranging from enterprise application integration to web-based data visualization. Juergen has particular experience in developing J2EE web applications, O/R mapping, and transaction management. Juergen is co-lead of the Spring Framework and active in many community forums, including TheServerSide. Most of all, I’d like to thank my spouse, Eva, for her boundless love and support, and for her under- standing of my constant lack of time. Special thanks to my colleagues at werk3AT and in particular to Werner Loibl for respecting all of my activities, and for giving valuable input to Spring and this book. I’m grateful to Thomas Risberg and Alef Arendsen for their thorough reviews and valuable input, and to all developers who helped sharpen the arguments, both within and outside the Spring team. It has been a particular pleasure to work with Rod on both Spring and this book.Introduction
Credits Vice President and Executive Group Publisher Richard Swadley Vice President and Executive Publisher Bob Ipsen Vice President and Publisher Joseph B. Wikert Executive Editorial Director Mary Bednarek Executive Editor Robert Elliott Editorial Manager Kathryn A. Malm Development Editor Adaobi Obi Tulton Technical Editors Gary Watson Andrew Smith Jason Carreira Production Editors Felicia Robinson Eric Newman Copy Editors C. M. Jones Michael Koch Media Development Specialist Kit Malone Text Design & Composition Wiley Composition Services
分享到:
收藏