Expert One-on-One J2EE Design and Development

Paperback
from $0.00

Author: Rod Johnson

ISBN-10: 0764543857

ISBN-13: 9780764543852

Category: Enterprise Application Development & Integration

What is this book about?\ The results of using J2EE in practice are often disappointing: applications are often slow, unduly complex, and take too long to develop. Rod Johnson believes that the problem lies not in J2EE itself, but in that it is often used badly. Many J2EE publications advocate approaches that, while fine in theory, often fail in reality, or deliver no real business value.\ Expert One-on-One: J2EE Design and Development aims to demystify J2EE development. Using a practical...

Search in google:

This guide to J2EE focuses on solving common problems and avoiding debilitating mistakes. Johnson (a Java architect) examines the complexities of J2EE services and advocates the simplest possible solutions. Specific instructions are offered for using distributed architecture, EJB, data access strategies, web interface design, and J2EE applications design. Annotation © 2004 Book News, Inc., Portland, OR

Introduction1J2EE Myths2How is this Book Different?5My Approach6Who this Book is for7Aims of this Book7What this Book Covers7Assumed Knowledge8Recommended Reading9What You Need to Use this Book9Chapter 1J2EE Architectures15Goals of an Enterprise Architecture16Deciding Whether to Use a Distributed Architecture18New Considerations in J2EE Design19When to Use EJB20Implications ofUsing EJB20Questionable Arguments for Using EJB22Compelling Arguments for Using EJB22Arguments for Using EJB to Consider on a Case-by-Case Basis23Accessing Data24J2EE Data Access Shibboleths24State Management26J2EE Architectures26Common Concepts27Non-distributed Architectures28Distributed Architectures32Web Tier Design36The Model View Controller (MVC) Architectural Pattern36Connectivity Between the Web Tier and Business Objects38Designing Applications for Portability38Summary40Chapter 2J2EE Projects: Choices and Risks43Developing a Policy on Specification Versions44Choosing an Application Server45When to Choose an Application Server46Defining the Requirements47Evaluation Criteria48Choice Process54Top Mistakes in Choosing an Application Server54The "Neat Technology" Trap55When to Use Alternative Technologies to Supplement J2EE56Portability Issues56What does Portability Mean?57A Pragmatic Approach to Portability58Staging Environments and Release Management58Building a Team60Team Structure60Choosing Development Tools63Visual Modeling Tools64IDEs64Build Utilities64Code Generators66Version Control67Identifying and Mitigating Risks67Summary71Chapter 3Testing J2EE Applications73What Can Testing Achieve?74Definitions75Testing Correctness76The XP Approach to Testing76Writing Test Cases78Unit Testing78Should Testing Strategy Affect How We Write Code?90Integration and Acceptance Testing92Testing Business Objects92Testing Web Interfaces100Design Implications105Testing Performance and Scalability105Load Testing EJBs and Other Business Objects106Load Testing Web Interfaces107Automating Tests107Complementary Approaches to Testing108Summary110Chapter 4Design Techniques and Coding Standards for J2EE Projects11300 Design Recommendations for J2EE Applications114Achieving Loose Coupling with Interfaces115Prefer Object Composition to Concrete Inheritance115The Template Method Design Pattern117The Strategy Design Pattern119Using Callbacks to Achieve Extensibility120The Observer Design Pattern122Consider Consolidating Method Parameters124Exception Handling--Checked or Unchecked Exceptions125Using Reflection132Using JavaBeans to Achieve Flexibility138Avoid a Proliferation of Singletons by Using an Application Registry139Refactoring142Coding Standards142Start from the Standard143Allocation of Responsibilities145Avoid Code Duplication146Avoid Literal Constants147Visibility and Scoping149Using the final Keyword153Implementing toString() Methods Useful for Diagnostics155Defensive Coding Practices156Prefer Arrays to Collections in Public Method Signatures157Documenting Code158Logging160Why (and How) Not to Reinvent the Wheel166Help! API Overload167Using Frameworks167Summary171Chapter 5Requirements for the Sample Application179Overview180User Populations180Public Internet Users180Box Office Users181Administrators182Assumptions182Scope Limitations183Delivery Schedule183Internet User Interface183Basic Workflow184Error Handling185Application Screens185Box Office User Interface198Non-Functional Requirements198Hardware and Software Environment199Summary200Chapter 6Applying J2EE Technologies203When is a Distributed Architecture Appropriate?204Distributed Applications and Scalability205Distributed Applications and Reliability206Scalable and Robust Architectures207High-level Architecture for the Sample Application209Deciding When to Use EJB209Using EJB to Implement a Distributed Architecture209Transaction Management210EJB and Authorization213EJB and Multi-threading214Declarative Configuration Management214The Downside of EJB214EJBs in the Sample Application222Deciding How to Use EJB223What Should EJBs Do?223When to Use Local or Remote Interfaces223Using EJBs in the Sample Application227Deciding when to use Asynchronous Calling with JMS228Message-Oriented Middleware (MOM) and JMS228Producing Messages228Consuming Messages229When to Use Asynchronous Calling232JMS in the Sample Application234Authentication and Authorization235The Standard Security Infrastructure235The Server Implementation237Deciding When to Use XML238Using XSLT in J2EE Applications238"Deep" Use of XML239Converting Between JavaBeans and XML241J2EE and XML in the Future244XML in the Sample Application245Caching to Improve Performance245Caching Options245A Caching Strategy for the Sample Application247Summary248Chapter 7Data Access in J2EE Applications251Data Access Goals252Business Logic and Persistence Logic252Object-Driven and Database-Driven Modeling: A Philosophical Debate253O/R Mapping and the "Impedance Mismatch"255The Data Access Object (DAO) Pattern257Working with Relational Databases259Referential Integrity259Stored Procedures, Triggers, and Views259RDBMS Performance Issues262Portability Versus Performance263Exchanging Data in Distributed Applications265The Value Object J2EE Pattern265"Generic" Value Objects267"Disconnected" Data Access Using JDBC Rowsets267Common Data Access Issues268Transaction Isolation268Pessimistic and Optimistic Locking269Primary Key Generation Strategies269Where to Perform Data Access273Data Access in the EJB Tier273Data Access in the Middle Tier without Using EJB275Data Access in the Web Tier276Summary278Data Modeling in the Sample Application278Chapter 8Data Access Using Entity Beans285Entity Bean Concepts286Definition287How Should We Use Entity Beans?288CMP Versus BMP292Entity Beans in EJB 2.0294Local Interfaces294Home Interface Business Methods295EJB 2.0 CMP296Entity Bean Caching300Entity Bean Locking Strategies301Read-only and "Read-mostly" Entities302Transactional Entity Caching304Entity Bean Performance305Tool Support for Entity Beans306Summary306Chapter 9Practical Data Access311Data Access Technology Choices312SQL-Based Technologies312O/R Mapping Technologies315Choosing a Data Access Strategy for the Sample Application319JDBC Subtleties320Correct Exception Handling320Extracting Information from SQLExceptions322The PreparedStatement Question323A Generic JDBC Abstraction Framework324Motivation325Aims326Exception Handling327Two Levels of Abstraction333A Framework to Control JDBC Workflow and Error Handling333A Higher Level of Abstraction: Modeling RDBMS Operations as Java Objects342JDBC Abstraction Summary351Implementing the DAO Pattern In the Sample Application353Summary360Chapter 10Session Beans363Using Stateless Session Beans364Benefits of Stateless Session Beans364Stateless Session Beans and Internal State365Implications of Stateless Session Bean Pooling365Using Stateful Session Beans366Why Not to Use Stateful Session Beans366When to Use Stateful Session Beans370Session Synchronization370Protecting Stateful Session Beans from Concurrent Calls371Patterns for Achieving Stateful Functionality with SLSBs371Using a Stateful Session Bean as Controller373J2EE Design Patterns Applicable to Session Beans373The Session Facade Pattern in Distributed J2EE Applications374The EJB Command Design Pattern374Session Bean Implementation Issues379Error Handling in EJBs379Transaction Attributes for EJBs using CMT382The Business Methods Interface "Pattern"386Session Beans in the Sample Application389Summary389Chapter 11Infrastructure and Application Implementation393Infrastructure394Goals of a Strong Infrastructure395Using a Framework to Configure Application Components396Managing API Complexity410Implementing Business Logic428Implementing the Sample Application428Summary437Chapter 12Web-Tier MVC Design441The Challenges of Web Development442Lessons Learned in Java Web Development443The Shortcomings of Servlet-only Solutions443JSP: Promise and Temptation444Striking a Balance446Web-Tier Design Goals447A Clean Web Tier447A Thin Web Tier447MVC Concepts and the Front Controller J2EE Pattern448Concepts449Pattern Variants453Implementation Goals455Web Application Frameworks456Common Concepts456Available Frameworks457Integrating a Web Application Framework into Overall Application Architecture465The Web Application Framework Used in the Sample Application467Design Goals468Basic MVC Control Flow469