bitter EJB Chinese version

Author: (USA) Tat et al. / Yu Han et al.
Publisher:
Publish Date: 2005-09-01
Features: "The wonderful writing style is one of the most comfortable technical books I've ever read. The explanations of concepts in the book have four characteristics: easy to understand, engaging, knowledge-rich, and focused on the topic." — Dave Wiltz, SBCGlobal
"Can help people strip away the overly glamorous exterior of Java enterprise development." — John D. Crabtree, Taliant Software
"Clearly, they know everything about this." — Jack Herrington, Code Generation Network
"This book is truly amazing." — Barry Nowak, GFS Marketplace
"Before you're overwhelmed, this book can help you identify the problem and point you in the right direction." — Jon Skeet, Peramon Technology
EJB, as the core server-side component of J2EE application development, appears as a savior of Java enterprise programming, known as the cure for Java development problems, hence its immense popularity. Its complexity can bring tremendous power, but at the same time, confusion and confusion follow closely. How can one effectively leverage EJB? This book discusses the hotly debated topic of today. The authors identify and explain common EJB pitfalls, elevating them to "antipatterns." These antipatterns can help people avoid important EJB issues, covering areas from persistence storage to performance. If you clearly understand what not to do, you will better appreciate the significance of the best practices described in the book.
Book Content:
■ When to use EJB and when not to use EJB
■ Managing session state
■ Alternatives to entity beans
■ Performance tuning techniques
■ Best practices with XDoclet, Ant, and JUnit
■ Avoiding pitfalls of various beans, including message-driven beans, entity beans, and session beans.
[Preface] I once told my long-time friend Mike Oehrtman about the adventure stories in BitterJava. In fact, he appears in at least half of the stories. I asked him if he had his own stories to share, as we were planning another Bitter series book. He said he could contribute some hiking stories. Hearing this, I couldn’t help but laugh and told him that just walking around doesn’t qualify as the kind of adventure I meant. Mike countered, "Trust me, you’ll love this story."
At that time, we were backpacking in Alaska. One day, we arrived at Denali National Park, where a park ranger told us we had to plan our trip. The park had a good monitoring system, so even if we didn’t see other visitors along the way, the ranger could know exactly where we were, with an error margin of no more than two miles. I’m quite experienced in travel, so reading maps wasn’t an issue. I made arrangements, packed a map, and took a bus, starting my journey into the remote wilderness. The bus was full of locals, and the driver was also a native of Alaska. His beard was incredibly long, even longer than that of Beth, who was sitting next to me.
During the journey, we saw countless wild animals: moose, elk, and even some wild sheep. If you could think of an animal, we saw it. After a turn, we came across a river, and a bear stood in front of us. This wasn’t the small brown bear we’d seen last year in the Smoky Mountains. This was a massive grizzly bear. Beth tapped my shoulder, signaling me to look to the other side of the bus, where I saw bears everywhere. I’d seen grizzly bears before, but seeing so many at once was a first. The bus slowed down as it passed through the bear herd, and I started to feel nervous. I worried that the bears might attack us, as there was plenty of food in the bus. Suddenly, the driver stopped the car, and I guessed he was just as scared as I was. However, he just sat still, and I started to sweat, wondering if the engine had failed.
Finally, the driver turned around and asked Beth and me, "Not getting off?" That’s when I realized. We had to get off at this stop. Yes, at that moment, we had to be surrounded by so many bears. I’ve never been so terrified before. People often ask me why I’m so passionate about this kind of work, sitting in front of a keyboard for ten hours straight, which is practically a daily routine. They inevitably associate writing with a dirty keyboard, a dusty monitor, and a monotonous desk. I’ve seen bears, and I’ve seen many bears. If you’re dedicated to Java development, I’m sure you’ve also encountered many "bears" in your eyes.
The first "bear" to tackle is the economy. I started writing in the early days of the 2000 economic recession. I’d written BitterJava, and I began working as a consultant during a time of chaos in the Java industry. Some of the foundational companies in the Java world were already shaky. Sun faced various challenges, and WebGain even disappeared. The power structure was changing. When writing this book, Oracle acquired TopLink, disrupting the balance in the object persistence storage market. IBM acquired Rational, which also greatly impacted its development.
My clients, readers, and students should also be aware of another "bear"—.NET. Whether for clients or Microsoft products, I believe .NET is a real bear. I need to understand what .NET can do in a corporate environment, whether it’s large enough to "eat" J2EE? Will its "attack" affect my life? So far, none of this has happened. However, the existence of this bear is undeniable, and it’s still devouring and growing.
The PetStore benchmark test (discussed in Chapter 1) made me feel the threat firsthand. Everything can change in an instant, and we just need to ensure one thing—never underestimate a dangerous competitor like Microsoft.
Another "bear" that truly terrified me is EJB. This industry has provided EJB with plenty of "nutrition." IBM, Sun, Oracle, BEA, and many other vendors are all heavily supporting EJB. EJB has "teeth": we’ll eventually see some commercial EJB applications grow massively. And EJB is also energetic: the application server market is still thriving. I’ve watched EJB from afar many times and quietly walked away, worried that this "bear" would turn toward me and tear me apart with its sharp teeth. And EJB certainly might turn toward you. EJB projects often fail, and the frequency of these failures is truly shocking. This possibility is also a topic of discussion in this book.
If you’ve carefully studied successful patterns and best practices, I think you’re a decent developer, but if you want to level up, you must also understand the limitations of the technology. Face EJB bravely, and you’ll be tested. This process will hone your skills and open your mind, but it’s also inevitable that you’ll get hurt.
Fortunately, there’s a better way to learn. BitterJava convinced me that learning from others’ mistakes is not only meaningful but also highly efficient. Following the story earlier, in this book, my co-authors and I finally got off the bus and faced these bears in reality. It’s not to say we recommend EJB for every project—not at all. We just point out that EJB has its place, and in the right circumstances, this "animal" can be extraordinary. So, get off the bus and explore the dark caves where the biggest bears are hiding. We need to understand both the dangers and the power of EJB.

📌 Related Posts