Book description
What is this book about?
Expert One-on-One J2EE Development without EJB shows Java developers and architects how to build robust J2EE applications without having to use Enterprise JavaBeans (EJB). This practical, code-intensive guide provides best practices for using simpler and more effective methods and tools, including JavaServer pages, servlets, and lightweight frameworks.
What does this book cover?
The book begins by examining the limits of EJB technology -- what it does well and not so well. Then the authors guide you through alternatives to EJB that you can use to create higher quality applications faster and at lower cost -- both agile methods as well as new classes of tools that have evolved over the past few years.
They then dive into the details, showing solutions based on the lightweight framework they pioneered on SourceForge -- one of the most innovative open source communities. They demonstrate how to leverage practical techniques and tools, including the popular open source Spring Framework and Hibernate. This book also guides you through productive solutions to core problems, such as transaction management, persistence, remoting, and Web tier design. You will examine how these alternatives affect testing, performance, and scalability, and discover how lightweight architectures can slash time and effort on many projects.
What will you learn from this book?
Here are some details on what you'll find in this book:
How to find the simplest and most maintainable architecture for your application
Effective transaction management without EJB
How to solve common problems in enterprise software development using AOP and Inversion of Control
Web tier design and the place of the Web tier in a well-designed J2EE application
Effective data access techniques for J2EE applications with JDBC, Hibernate, and JDO
How to leverage open source products to improve productivity and reduce custom coding
How to design for optimal performance and scalability
Table of contents
- Copyright
- About the Authors
- Credits
- Introduction
- 1. Why "J2EE Without EJB"?
-
2. Goals
- 2.1. Productivity
- 2.2. OO
- 2.3. The Importance of Business Requirements
- 2.4. The Importance of an Empirical Process
- 2.5. Summary
-
3. Architectures
-
3.1. Architectural Building Blocks
-
3.1.1. The Business Services Layer
- 3.1.1.1. Stateless or Stateful?
-
3.1.1.2. Popular Service Layers
- 3.1.1.2.1. Session EJBs
- 3.1.1.2.2. Stateless Session Beans with Remote Interfaces
- 3.1.1.2.3. Stateless Session Beans with Local Interfaces
- 3.1.1.2.4. Common Issues with EJB Service Layers
- 3.1.1.2.5. .NET "Serviced Components"
- 3.1.1.2.6. MVC Web Actions
- 3.1.1.2.7. Service Layer Running in a Lightweight Container
- 3.1.1.2.8. Service Layers Compared
- 3.1.2. Exposing Business Objects to the World
- 3.1.3. Data Access Layer, or EIS Tier
-
3.1.1. The Business Services Layer
- 3.2. J2EE Architectures
- 3.3. J2EE Architectures in Practice
- 3.4. Deciding Whether an Application Needs an Application Server
- 3.5. Summary
-
3.1. Architectural Building Blocks
-
4. The Simplicity Dividend
- 4.1. The Cost of Complexity
-
4.2. Causes of Complexity in J2EE Applications
- 4.2.1. Architectural Causes of Complexity
- 4.2.2. Cultural Causes of Complexity: The Complexity Industry
- 4.3. How Much Complexity Is too Much Complexity?
- 4.4. Summary
-
5. EJB, Five Years On
- 5.1. Hype and Experience
- 5.2. An Aging Component Model
- 5.3. What Do We Really Want from EJB, or Why Stateless Session Beans Are So Popular
-
5.4. What Don't We Want from EJB?
- 5.4.1. The Monolithic, Distinct Container Problem
- 5.4.2. Inelegance and the Proliferation of Classes
- 5.4.3. Deployment Descriptor Hell
- 5.4.4. Class Loader Hell
- 5.4.5. Testing
- 5.4.6. EJB Overdose
- 5.4.7. Complex Programming Model
- 5.4.8. Simple Things Can Be Hard
- 5.4.9. Is the Goal of Enabling Developers to Ignore the Complexity of Enterprise Applications Even Desirable?
- 5.4.10. Loss of Productivity
- 5.4.11. Portability Problems
- 5.5. Can EJB Reinvent Itself?
- 5.6. Myths and Fallacies
- 5.7. Moving Forward
- 5.8. Summary
-
6. Lightweight Containers and Inversion of Control
- 6.1. Lightweight Containers
- 6.2. Managing Business Objects
- 6.3. Inversion of Control
- 6.4. Implications for Coding Style, Testing, and Development Process
- 6.5. Applying Enterprise Services
- 6.6. Summary
-
7. Introducing the Spring Framework
- 7.1. History and Motivation
- 7.2. A Layered Application Framework
- 7.3. The Core Bean Factory
- 7.4. Resource Setup
- 7.5. The Spring Application Context
- 7.6. Summary
-
8. Declarative Middleware Using AOP Concepts
- 8.1. AOP 101
- 8.2. EJB as a Subset of AOP
- 8.3. AOP Implementation Strategies
- 8.4. AOP Implementations
- 8.5. AOP Design Issues
- 8.6. J2EE à la carte
- 8.7. AOP in Practice with Spring
- 8.8. Using Source-level Metadata to Provide an Abstraction above AOP
- 8.9. Implications for Programming Style
- 8.10. References
- 8.11. Summary
-
9. Transaction Management
- 9.1. High-level Transaction Management
- 9.2. Classic J2EE Transaction Management
- 9.3. Lightweight Transaction Infrastructure
- 9.4. Transaction Management with the Spring Framework
- 9.5. Summary
-
10. Persistence
- 10.1. Common Persistence Strategies
- 10.2. A Brief History of Java Persistence Technologies
- 10.3. Data Access Technologies in Practice
- 10.4. The Data Access Object Pattern
- 10.5. Data Access with the Spring Framework
- 10.6. Summary
- 11. Remoting
-
12. Replacing Other EJB Services
-
12.1. Thread Management
-
12.1.1. Threading Myths
- 12.1.1.1. Do Stateless Service Objects Need to Be Single Threaded?
- 12.1.1.2. The Cost of Instance Creation
- 12.1.1.3. Resource Management
- 12.1.1.4. Should the Solution Totally Reject the Java Threading Model?
- 12.1.1.5. Does the EJB Threading Model Provide a Complete Concurrency Solution?
- 12.1.1.6. The Tradeoffs in the EJB Solution
- 12.1.2. The EJB Threading Model
-
12.1.1. Threading Myths
- 12.2. EJB Instance Pooling
- 12.3. Alternatives to EJB Threading and Pooling
- 12.4. Declarative Security
- 12.5. JMS and Message-driven Beans
- 12.6. Summary
-
12.1. Thread Management
- 13. Web Tier Design
-
14. Unit Testing and Testability
- 14.1. Why Testing Matters
- 14.2. Goals of Unit Testing
-
14.3. Ensuring Testability
- 14.3.1. Programming Style
- 14.3.2. How to Make Your Code Hard to Test
- 14.3.3. Standard Library Challenges
-
14.3.4. Techniques for Improving Testability
- 14.3.4.1. Code to Interfaces Rather than Classes
- 14.3.4.2. Use the Strategy Design Pattern
- 14.3.4.3. Consider the "Law of Demeter"
- 14.3.4.4. Minimize Dependence on Environment-specific APIs
- 14.3.4.5. Ensure That Each Object Has a Consistent Set of Responsibilities
- 14.3.4.6. Hide Implementation Details
- 14.3.4.7. Refactor into Methods to Allow Overriding
- 14.3.5. Inversion of Control
- 14.3.6. AOP
- 14.4. Unit Testing Techniques
-
14.5. Test-driven Development (TDD)
- 14.5.1. Benefits
-
14.5.2. Arguments against TDD
- 14.5.2.1. "TDD Means That There Won't Be an Overall Theme to the Design"
- 14.5.2.2. "But TDD Goes out the Window When You Have a Deadline"
- 14.5.2.3. "TDD Takes Longer, and the Client Won't Pay for It"
- 14.5.2.4. "We Want Developers to Generate Code from a Model, Not Hack in Their IDE"
- 14.5.2.5. "We Don't Like XP"
- 14.5.3. Practicing TDD
- 14.5.4. Learning TDD
- 14.6. Case Study: The Spring Experience
- 14.7. Testing Spring Applications
- 14.8. Coverage Analysis and Other Test Tools
- 14.9. Resources
- 14.10. Summary
-
15. Performance and Scalability
- 15.1. Definitions
- 15.2. Setting Clear Goals
- 15.3. Architectural Choices: The Key to Performance and Scalability
-
15.4. Implementation Choices
-
15.4.1. The Performance Implications of Dispensing with EJB Service Provision
- 15.4.1.1. Benchmark Methodology
- 15.4.1.2. Declarative and Programmatic Middleware Models
- 15.4.1.3. Remote SLSB with CMT
- 15.4.1.4. Local SLSB with CMT
- 15.4.1.5. AOP Transaction Management
- 15.4.1.6. Programmatic Transaction Management
- 15.4.1.7. Threading Models
- 15.4.1.8. Shared Multithreaded Object
- 15.4.1.9. Spring Instance Pooling
- 15.4.1.10. Result Summary and Conclusions
-
15.4.2. Caching and Code Optimization
- 15.4.2.1. Code Optimization and Why to Avoid it
- 15.4.2.2. Caching
- 15.4.2.3. Potential Code Optimizations
- 15.4.2.4. Start with Algorithms
- 15.4.2.5. Use the Correct Collection Type
- 15.4.2.6. Avoid Unnecessary String Operations
- 15.4.2.7. Unnecessary Logging
- 15.4.2.8. Contentious Optimizations
- 15.4.2.9. Opportunities to Improve Tests
-
15.4.1. The Performance Implications of Dispensing with EJB Service Provision
- 15.5. Tuning and Deployment
- 15.6. An Evidence-based Approach to Performance
- 15.7. Resources
- 15.8. Summary
- 16. The Sample Application
- 17. Conclusion
Product information
- Title: Expert One-on-One™ J2EE™ Development without EJB™
- Author(s):
- Release date: June 2004
- Publisher(s): Wrox
- ISBN: 9780764558313
You might also like
book
Advanced JavaServer Pages™
Design and implement flexible, extensible, and maintainable applications with servlets and JSP technology Master powerful authentication …
article
Reinventing the Organization for GenAI and LLMs
Previous technology breakthroughs did not upend organizational structure, but generative AI and LLMs will. We now …
book
Building Java™ Enterprise Systems with J2EE™
The practical angle of Building Java Enterprise Systems with J2EE provides the conceptual background and wealth …
book
Beginning Spring
Get up to speed quickly with this comprehensive guide to Spring Beginning Spring is the complete …