Bitter EJB


Addressing the storming controversy of EJB head-on, this guide discusses framework problems and common traps that can snare unwary developers. Advice is provided for choosing persistence strategies beyond EJB entity beans and a list of several entity bean antipatterns. Also offered are session bean and messaging antipatterns and a compelling discussion about how and when to use problematic stateful session beans. Solutions to difficult problems such as effective builds and performance tuning are furnished. ...

See more details below
$40.86 price
(Save 9%)$44.95 List Price
Other sellers (Paperback)
  • All (22) from $1.99   
  • New (11) from $6.95   
  • Used (11) from $1.99   
Sending request ...


Addressing the storming controversy of EJB head-on, this guide discusses framework problems and common traps that can snare unwary developers. Advice is provided for choosing persistence strategies beyond EJB entity beans and a list of several entity bean antipatterns. Also offered are session bean and messaging antipatterns and a compelling discussion about how and when to use problematic stateful session beans. Solutions to difficult problems such as effective builds and performance tuning are furnished. Designed for EJB developers, architects, programmers, and project managers, this authoritative reference attacks basic Java programming problems to establish antipatterns as a serious field for Java developers in a well-known context.

Read More Show Less

Product Details

  • ISBN-13: 9781930110953
  • Publisher: Manning Publications Company
  • Publication date: 6/15/2003
  • Pages: 412
  • Product dimensions: 7.46 (w) x 9.22 (h) x 0.95 (d)

Meet the Author

Bruce Tate is an Internet architect who developed the bitter Java concept after seeing a set of customer problems repeated, collecting their stories, and publishing the solutions. He is the author of "Bitter Java," He lives in Austin, Texas. Mike Clark is president of Clarkware Consulting, Inc. He first encountered EJB pitfalls in 1998 while developing a custom EJB container, prior to the emergence of commercial J2EE servers. He has significantly contributed to the successful delivery of a popular J2EE performance management product and has also created several open source tools including JUnitPerf for automated performance testing. He lives in Parker, Colorado. Bob Lee is an OCI consultant with expertise in AOP, Jini, and web security. He developed an open source AOP framework that utilizes runtime bytecode engineering to intercept method invocations on POJOs and forms the foundation of JBoss AOP. He lives in St. Louis, Missouri. Patrick Linskey is the vice president of engineering for SolarMetric, a company that offers Java persistence alternatives to the Java community. His experience spans EJB application development and product development, and he is a teacher and speaker on the Java conference circuit. He lives in Washington, D.C.

Clark is a consultant, author, speaker, and programmer. He helps teams build better software faster through his company, Clarkware Consulting, Inc.

Lee is an independent consultant and open source developer.

Linskey is the VP Engineering for Solarmetric, which offers Java persistence alternatives to the Java community.

Read More Show Less

Table of Contents

Preface xv
Acknowledgments xviii
About this book xxii
Part 1 The basics 1
1 Bitter choices 3
1.1 A storm of controversy 5
1.2 A history of EJB antipatterns 6
1.3 A case study: Benchmarking PetStore 9
1.4 Antipattern: The Golden Hammer 12
1.5 Summary: Looking ahead 19
1.6 Antipatterns in this chapter 20
2 The bitter cost 21
2.1 Sparking controversy 22
2.2 Antipattern: A Sledgehammer for a Fly 30
2.3 Entity beans are a horse of a different color 41
2.4 Entity beans: Take two 43
2.5 Entity beans--a closer look 45
2.6 Summary 50
2.7 Antipatterns in this chapter 51
3 Bitter interfaces 52
3.1 Building a good interface 53
3.2 Designing the application tier 57
3.3 Antipattern: Local & Remote Interfaces Simultaneously 60
3.4 Antipattern: Customers in the Kitchen 66
3.5 Antipattern: Custom DTOs 73
3.6 Summary 77
3.7 Antipatterns in this chapter 78
Part 2 Sessions and messages 81
4 Bitter sessions 83
4.1 Threading and synchronization 85
4.2 Handling exceptions 92
4.3 Iterating large datasets 99
4.4 Interoperating efficiently 111
4.5 Summary 120
4.6 Antipatterns in this chapter 121
5 Bitter session states 126
5.1 Making a case for session state 128
5.2 A pivotal antipattern: Conversational Baggage 129
5.3 Managing sessions with stateful session beans 134
5.4 Managing sessions with servlets 140
5.5 Antipattern: Golden Hammers of Session State 143
5.6 Mini-antipattern: Stateful Session Beans as Shared Data Caches 151
5.7 Antipattern: Session Hodgepodge 152
5.8 Mini-antipattern: Session Thrashing 155
5.9 Mini-antipattern: Rotting Session Garbage 155
5.10 Summary: Taming the beast 156
5.11 Antipatterns in this chapter 157
6 Bitter messages 162
6.1 A brief overview of JMS 163
6.2 An early antipattern: Fat Messages 165
6.3 Mini-antipattern: Skinny Messages 169
6.4 Seeds of an order processing system 171
6.5 Antipattern: XML as the Silver Bullet 177
6.6 Antipattern: Packrat 179
6.7 Mini-antipattern: Immediate Reply Requested 182
6.8 Using message-driven beans (MDBs) 184
6.9 Antipattern: Monolithic Consumer 188
6.10 Antipattern: Hot Potato 191
6.11 Antipattern: Slow Eater 194
6.12 Antipattern: Eavesdropping 195
6.13 Antipattern: Performance Afterthoughts 199
6.14 Summary: Getting the message 201
6.15 Antipatterns in this chapter 202
Part 3 EJB persistence 211
7 Bitter entities 213
7.1 Understanding entity bean antipatterns 214
7.2 Antipattern: Face Off 215
7.3 Antipattern: Ham Sandwich; Hold the Ham 222
7.4 Antipattern: Application Joins 228
7.5 Antipattern: Application Filters 230
7.6 Antipattern: Rusty Keys 233
7.7 Antipattern: Revolving Doors 235
7.8 Summary 239
7.9 Antipatterns in this chapter 240
8 Bitter alternatives 245
8.1 Understanding entity bean alternatives 246
8.2 Using EJB persistence 249
8.3 Simplify with JDBC 260
8.4 Using object persistence frameworks 267
8.5 Antipattern: Persistent Problems 275
8.6 Solution: Do not "inherit" a persistence architecture--choose it 282
8.7 Summary 283
8.8 Antipatterns in this chapter 284
Part 4 Broader topics 285
9 Bitter tunes 287
9.1 Measures of success 289
9.2 Antipattern: Premature Optimization 291
9.3 Antipattern: Performance Afterthoughts 296
9.4 Grist for the tuning mill 298
9.5 Antipattern: Thrash-tuning 303
9.6 Mini-antipattern: Manual Performance Testing 305
9.7 Automated performance testing with JUnitPerf 307
9.8 Modeling performance 315
9.9 Mini-antipattern: Stage Fright 317
9.10 Summary: Tuning with confidence 318
9.11 Antipatterns in this chapter 319
10 Bitter builds 324
10.1 Wrapping big packages without bows 326
10.2 Antipattern: System Loaded Application Classes 332
10.3 Antipattern: EJB Code Duplication 332
10.4 Antipattern: Build Guru 337
10.5 Antipattern: Running with Scissors 339
10.6 Antipattern: Integration Hell 341
10.7 Summary 342
10.8 Antipatterns in this chapter 343
11 A bittersweet future 348
11.1 Marking our place in history 349
11.2 Plotting the next moves 351
11.3 Antipatterns and next moves 355
A Bitter tales 356
A.1 A Java development free fall 357
Antipatterns in life 359
A.2 Using design patterns accentuates the positive 360
Design patterns online 361
UML provides a language for patterns 362
A.3 Antipatterns teach from the negative 362
Some well-known antipatterns 363
Antipatterns in practice 364
Antipattern resources 365
A.4 Antipattern ideas are not new 366
Learning from the industry 367
Detective work 368
Refactoring antipatterns 370
A.5 Why Bitter Java? 370
The Bitter Java approach 371
Bitter Java tools 371
The Bitter Java organization 372
The Bitter Java audience 373
A.6 Looking ahead 374
B Bitter basics 376
B.1 Developing in the EJB architecture 378
Getting acquainted with the cast, the bean triad 378
Know your host, the EJB container 381
B.2 Crafting enterprise beans 384
Defining the client interfaces 385
Implementing the business logic 390
Playing it safe with transactions 397
Configuring the bean 397
Packaging it 399
Invoking your beans from a client 400
Bibliography 401
Index 403
Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing 1 Customer Reviews
  • Anonymous

    Posted September 29, 2003

    Handy Reference

    Enterprise JavaBeans (EJB) are the server-side core of J2EE application development. While there are plenty of books and literature on the subject, few actually discuss framework problems and Entity/Session Bean antipatterns so lucidly as this one. This one tells you about the why's and why not's to many of the EJB related questions and concerns you may encounter during the development cycle. Although not a reference manual, the coverage is both broad (covering the various types of EJB) and deep (including discussions of transactions, interfaces, deployment descriptors, build systems, testing, and performance). Antipatterns are dealt with in-depth as a pitfall to avoid. Overall a very good book and handy reference for EJB development. You would need to complement this book with another 'pro' pattern EJB book.

    Was this review helpful? Yes  No   Report this review
Sort by: Showing 1 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)