
Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Core J2EE Patterns: Best Practices and Design Strategies First Edition
- ISBN-100130648841
- ISBN-13978-0130648846
- EditionFirst Edition
- PublisherPrentice Hall Ptr
- Publication dateJanuary 1, 2001
- LanguageEnglish
- Dimensions7 x 1.5 x 9 inches
- Print length459 pages
There is a newer edition of this item:
$18.00
(66)
Only 1 left in stock - order soon.
Similar items that may deliver to you quickly
Editorial Reviews
Amazon.com Review
As is usual with pattern books, you won't find much code here. The book majors on problem discussions, analysis of the factors you should consider in your design, and strategies for the solution implementation. The authors constantly encourage abstraction, code modularity, non-duplication of code, network efficiency, code maintainability, and solution reusability.
While these are the aims we've been encouraged to pursue for years, too many pattern books operate at such a high theoretical level they fail to appeal to working programmers. In practice, you could use the patterns discussed with any language, but by concentrating on using Java, Core J2EE Patterns is able to take a more hands-on approach.
Okay, so you won't find detail at the level of APIs, but you will find discussion of where to implement functionality to best leverage Java's architecture and which Java mechanisms to use: for example, implementing entity beans as coarse-grained--rather than fine-grained--objects to reduce the transaction overhead. Not the sort of implementation advice you'll find in language-agnostic pattern books.
Core J2EE Patterns enables you to dramatically cut the design time on enterprise-level Java-based projects while increasing the likelihood that the project will reach a timely fruition. Recommended. --Steve Patient, Amazon.co.uk
From the Back Cover
Over the last few years, Java 2 Platform, Enterprise Edition (J2EE) technology has emerged and matured as a standard platform for building enterprise applications. While the platform has matured into a solid offering for developing and deploying enterprise applications, it does offer its challenges. As developers, often we confuse learning the technology with learning to design with the technology. In this book, senior architects from the Sun Java Center, Sun's Java consulting organization share with the reader their cumulative design experience with and expertise on J2EE technology.
The primary focus of the book is on patterns, best practices, design strategies, and proven solutions using the key J2EE technologies including JavaServer Pages (JSP), Servlets, Enterprise Java Beans (EJB), and Java Message Service (J.M.S) API. Other ancillary technologies like JDBC and JNDI are also discussed as relevant to their usage in these patterns. The J2EE Patterns catalog with 16 patterns and numerous strategies is presented to document and promote best practices for these technologies.
In addition to the patterns and strategies, the book offers the following:
- Presents various design strategies for the presentation tier and business tier design.
- Identifies bad practices in presentation, business, and integration tiers, and offers directions to remedy them by using certain patterns, strategies, and refactorings.
- Refactorings for various tiers and mechanics to move away from a bad implementation to a better solution.
- Sample code and examples for patterns, strategies, and refactorings.
Core J2EE Patterns delivers:
- Proven solutions for enterprise applications
- J2EE Patterns Catalog with patterns for JSP technology, EJB technology, and J.M.S.
- Identifies bad practices and recommends solutions
- Refactorings to improve existing designs using patterns, strategies, and best practices
- UML Diagrams illustrate structure and behavior of each pattern
About the Author
JOHN CRUPI is the Chief Java Architect of the Sun Java Center. He has over 15 years of experience in distributed object computing.
DAN MALKS is an Enterprise Java Architect with the Sun Java Center with over 14 years of experience.
Excerpt. © Reprinted by permission. All rights reserved.
The authors of Core J2EE Patterns have harvested a really useful set of patterns. They show you how to apply these patterns and how to refactor your system to take advantage of them. It's just like having a team of experts sitting at your side.
In the world of software, a pattern is a tangible manifestation of an organization's tribal memory. A pattern provides a common solution to a common problem and so, within the culture of one specific organization or within one domain, naming and then specifying a pattern represents the codification of a common solution, drawn from proven, prior experience. Having a good language of patterns at your disposal is like having an extended team of experts sitting at your side during development: by applying one of their patterns, you in effect take the benefit of their hard-won knowledge. As such, the best patterns are not so much invented as they are discovered and then harvested from existing, successful systems. Thus, at its most mature state, a pattern is full of things that work, absent of things that don't work, and revealing of the wisdom and rationale of its designers.
Deep, really useful, patterns are typically ancient: you see one and will often remark, "Hey, I've done that before." However, the very naming of the pattern gives you a vocabulary that you didn't have previously and so helps you apply that pattern in ways you otherwise might have not have realized. Ultimately, the effect of such a pattern will be to make your system simpler. Patterns not only help you build simpler systems that work, but they also help you build beautiful programs. In a culture of time starvation, writing beautiful software is often impossible. That's sad,
for as professionals, we strive to build things of quality.
By applying a good set of patterns, it is possible to bring a degree of elegance in to your systems that might otherwise have been lacking. The authors of Core J2EE Patterns have harvested a really useful set of patterns. Don't get me wrong: J2EE is certainly an important platform, enabling teams to build some very powerful systems. However, reality is, there is still a wide semantic gap between the abstractions and services that J2EE provides and the final application that a team must build. Patterns such as specified in this book represent solutions that appear again and again in filling that gap.
By applying these patterns, you thus carry out the primary means of reducing software risk: you write less software. Rather than discovering these solutions on your own, apply these patterns, which have already proven their utility in existing systems.
More than just naming a set of patterns, the authors make them approachable by specifying their semantics using the UML. Additionally, they show you how to apply these patterns and how to refactor your system to take advantage of them. Again, it's just like having a team of experts sitting at your side.
Grady Booch
Chief Scientist
Rational Software Corporation
Excerpt. © Reprinted by permission. All rights reserved.
Preface
This book is about patterns for the Java 2 platform, Enterprise Edition (J2EE). These J2EE patterns provide solutions for problems typically encountered by designers of software applications for the J2EE platform. All the patterns documented in the catalog have been discovered in the field, where they have been used to create successful J2EE applications for our customers.
This book describes proven solutions for the J2EE platform with a particular emphasis on such key J2EE technologies as: Java Server Pages (JSP), Servlets, Enterprise JavaBeans (EJB) components, Java Message Service (JMS), JDBC, and Java Naming and Directory Interface (JNDI). We offer solutions for recurring problems for the J2EE platform through the J2EE pattern catalog and J2EE refactorings. You can apply these ideas when developing new systems or when improving the design of existing systems. The patterns in this book will help you quickly gain the proficiency and skills to build robust, efficient enterprise applications.
Today, as in the past, many of us naively assume that learning a technology is synonymous with learning to design with the technology. Certainly learning the technology is an important part to being successful in designing with the technology. Many existing Java books are excellent at explaining technology details, such as API specifics and so forth, but at the same time they give no insight on applying the technology. Learning to design comes from experience and from sharing knowledge on best practices and bad practices.
The experiences we have conveyed in this book are derived from the work we have done in the field. We are part of Sun Microsystems, Inc.'s Sun Java Center (SJC) consulting organization. In our work, we often encounter situations where, because technology is moving so quickly, designers and developers are still struggling to understand the technology, let alone how to design with the technology.
It is not good enough to tell designers and developers to write good code, nor is it sufficient to suggest using Servlets and JSP for developing the presentation tier and EJB components for developing the business tier.
So, given this scenario, where does an aspiring J2EE architect learn not only what to do, but what not to do? What are the best practices? What are the bad practices? How do you go from problem to design to implementation?
Sun Java Center and the J2EE Pattern Catalog
Since its inception, SJC architects have been working with clients all over the world to successfully design, architect, build, and deploy various types of systems based on Java and J2EE. The SJC is a rapidly growing consulting organization constantly adding new hires to its ranks of experienced architects.
Recognizing the need to capture and share proven designs and architectures, we started to document our work on the J2EE platform in the form of patterns in 1999. Although we looked in the existing literature, we could not find a catalog of patterns that dealt specifically with the J2EE platform. We found many books dealing with one or more of the J2EE technologies, and these books do an excellent job of explaining the technology and unraveling the nuances of the specifications. Some books offered extra help by providing some design considerations.
Since we first publicly presented our ideas on J2EE patterns at the JavaOne Conference in June 2000, we have received an overwhelming response from architects and developers. While some individuals expressed great interest in learning more about the patterns, others confirmed that they had applied the patterns, but had never named or documented them. This interest in patterns for the J2EE platform further motivated us to continue our work.
Thus, we put together the J2EE Pattern Catalog., which was initially made available to the entire J2EE community in beta form via the Java Developer Connection in March, 2001. Based largely on community feedback, the beta documentation evolved into the release you see in this book.
We hope these patterns, best practices, strategies, bad practices, and refactorings for the J2EE platform, provide the same benefits to you as they do for us.
What This Book Is About
This book is about:
Using patterns for the J2EE Platform. Based on our collective J2EE platform experience, we have assembled the pattern catalog in this book. The J2EE Pattern Catalog describes various best practices related to architecting and designing applications for the J2EE platform. This book focuses on the following four J2EE technologies: Servlets, JSP, EJB components, and JMS. Using best practices to design applications that use JSP, Servlet, EJB components, and JMS technologies. It is not sufficient to merely learn the technology and the APIs. It is equally important to learn to design with the technology. We have documented what we have experienced to be the best practices for these technologies. Preventing re-inventing-the-wheel when it comes to design and architecture for the J2EE platform. Patterns promote design reuse. Reusing known solutions reduces the cycle time for designing and developing applications, including J2EE applications. Identifying bad practices in existing designs and refactoring these designs to move to a better solution using the J2EE patterns. Knowing what works well is good. Knowing what does not work is equally important. We have documented some of the bad practices we have experienced when designing applications for the J2EE platform.What This Book Is Not
This book is not about:
How to program with Java or J2EE technologies. This book is not about programming. While this book is heavily based on the J2EE technologies, we do not describe the specific APIs. If you wish to learn about programming using Java or using any of the J2EE technologies, there are a number of excellent books and online resources from which to learn. The online tutorials on the official Java home page at http://java.sun.com are highly recommended if you wish to learn about individual technologies. The official specifications for J2EE technologies are also available from the Java home page. What process and methodology to use. We do not suggest any type of process or methodology to use since the material presented in this book is not related to either. Hence, this book does not teach you about a process or methodology to follow in your projects. If you would like to learn more about processes and methodologies, there are a good number of books that deal with various object-oriented methodologies and new books on lightweight processes, such as Extreme Programming. How to use Unified Modeling Language (UML). This book is not going to teach you about UML. We use UML extensively (specifically class and sequence diagrams) to document the patterns and describe the static and dynamic interactions. If you want to learn more about UML, please refer to the UML User Guide Booch and the UML Reference Manual Rumbaugh by Grady Booch, Ivar Jacobson, and James Rumbaugh.Who Should Read This Book?
This book is for all J2EE enthusiasts, programmers, architects, developers, and technical managers. In short, anyone who is remotely interested in designing, architecting, and developing applications for the J2EE platform.
We have attempted to distinguish this book as a training guide for J2EE architects and designers. We all recognize the importance of good designs and well-architected projects, and that we need good architects to get there.
The use of well-documented patterns, best practices, and bad practices to share and transfer knowledge and experience can prove invaluable for teams with varied experience levels, and we hope that this book answers some of these needs.
How This Book Is Organized
This book is organized into three parts.
Part 1"Patterns and J2EE," consists of Chapter 1 and Chapter 2.
Chapter 1: "Introduction" on page 4 is a brief discussion on various topics, including patterns, J2EE platform, defining a pattern, and pattern categorization. It ends by introducing the J2EE patterns catalog.
Chapter 2: "J2EE Platform Overview" on page 16 provides a high level overview of the J2EE platform for those readers unfamiliar with J2EE, or who wish to refresh their knowledge of the J2EE platform.
Part 2"Design Considerations, Bad Practices, and Refactorings" deals with design considerations for JSP, Servlets, and enterprise beans. This part also includes bad practices and refactorings for the J2EE platform. This part is comprised of Chapter 3, 4, and 5.
Chapter 3: "Presentation Tier Design Considerations and Bad Practices" on page 34 and Chapter 4: "Business Tier Design Considerations and Bad Practices" on page 54 discuss the design considerations and bad practices for the presentation tier and business/integration tiers respectively. The design considerations are issues that a J2EE developer/designer/architect needs to consider while working with the J2EE platform. The topics presented in these chapters point the reader to other sources (such as official specifications and well written books on these topics) for more detailed information on these issues.
Chapter 5: "J2EE Refactorings" on page 72 includes some of the refactorings we have experienced in our work in the field that has enabled us to move our design from a less optimal solution to a better solution. The refactorings provide another way to think about the material in the rest of the book, providing what we believe to be valuable companion material to the pattern catalog. This chapter shows how we have been influenced by Martin Fowler and his book "Refactoring" Fowler. For those readers who are familiar with the Refactoring book, the format of this chapter will be very familiar. However, the content of this chapter is entirely in the context of J2EE technologies, whereas Martin Fowler addresses refactoring at a different level.
Part 3"J2EE Pattern Catalog" presents the J2EE pattern catalog. The catalog contains the fifteen patterns that form the core of this book. This part is comprised of Chapter 6, 7, 8, and 9.
Chapter 6: "J2EE Patterns Overview" on page 124 provides an overview of the J2EE pattern catalog. This chapter begins with a high level discussion of the pattern ideas and explains the way the patterns are categorized into tiers. It also explains the J2EE pattern template, which is used to present all patterns in this book. The chapter discusses all the J2EE patterns and uses a diagram to show their inter-relationships. It also provides what we have termed a roadmap to the pattern catalog. This roadmap presents common J2EE design and architecture-related questions with references to patterns or refactorings that provide solutions to these questions. Understanding the pattern relationships and the roadmap is key to using these patterns.
Chapter 7: "Presentation Tier Patterns" on page 150 presents six patterns that pertain to using Servlets, JSP, JavaBeans, and custom tags to design web-based applications for the J2EE platform. The patterns describe numerous implementation strategies, and address common problems such as request handling, application partitioning, and generating composite displays.
Chapter 8: "Business Tier Patterns" on page 246 presents seven patterns that pertain to using EJB technology to design business components for the J2EE platform. The patterns in this chapter provide the best practices for using the EJB and JMS technologies. Where relevant, these patterns include discussion on other technologies, such as JNDI and JDBC.
Chapter 9: "Integration Tier Patterns" on page 388 presents two patterns that pertain to integrating J2EE applications with the resource tier and external systems. The patterns deal with using JDBC and JMS to enable integration between business tier and resource tier components.
Epilogue: "J2EE Patterns Applied" on page 422 discusses realizing sample use cases with the patterns. This chapter discusses and demonstrates how patterns are combined and work together. This chapter reinforces the idea that patterns exist in a community, and that each pattern supports, and is supported by, other patterns.
Companion Website and Contact Information
The official companion website where we will provide updates and other material is http://www.phptr.com/corej2eepatterns
The J2EE Patterns interest group, j2eepatterns-interest@java.sun.com is available for public subscription and participation. To subscribe to the interest group and review the discussion archives, please visit:
http://archives.java.sun.com/archives/j2eepatterns-interest.htmlProduct details
- Publisher : Prentice Hall Ptr; First Edition (January 1, 2001)
- Language : English
- Paperback : 459 pages
- ISBN-10 : 0130648841
- ISBN-13 : 978-0130648846
- Item Weight : 2.08 pounds
- Dimensions : 7 x 1.5 x 9 inches
- Customer Reviews:
About the author

Discover more of the author’s books, see similar authors, read book recommendations and more.
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on AmazonTop reviews from the United States
There was a problem filtering reviews right now. Please try again later.
- Reviewed in the United States on March 14, 2002I've been designing J2EE architectures for a few years now and I was really impressed with this book. It has collected and published in one place things that I've slowly learned (often the hard way) over the years. For that reason I think it's a great resource.
That said, it's a little high level and the authors repeat themselves quite often. But I think that is OK when using the book as a reference but when reading straight through it gets annoying. But that doesn't take away from a great book. If you're designing J2EE architectures, you should know all the patterns in this book.
- Reviewed in the United States on August 22, 2002This book is a must if your are in the J2EE industry and unless you are content to being a head-down coder! All the architects and serious developers, who not only wants to make the sw work but wants to make it efficient and well-structured too, should go thru it, the examples are very helpful and categorizing the patterns in three different tiers provide a intuitive way to look at those.
Without making this review any longer, what I'll suggest, NOT as a prerequisite, but as a supplement, is the Gang of Four's (Eric gamma et. al.) 'Design Patterns' book...
- Reviewed in the United States on December 12, 2013Must be in your rucksack, if you are even thinking about J2EE. Wonderful intro and design tradeoff discussions for all options in J2EE.
- Reviewed in the United States on February 8, 2003I found this book a solid and useful resource on many points. For me however it was not as solid on points I care most about.
One Patterns community goal is to establish a vocabulary for designers and architects that makes it easier to communicate. Instead of using source code to give those expressions form, we would rather use visual diagrams to capture compile-time and run-time relationships among the roles, or "object participants,' in a design.
In my opnion, few of the J2EE patterns described benefit from this methodology; some class diagrams merely restate a GoF pattern in a J2EE tier context. Some are so trivial (DAO comes to mind right away) they aren't worth diagramming at all. Clearly some things labelled patterns are really just refactorings or idioms. The authors don't deny this odr defend the use of patterns where there really isn't one, but still, blurring the terms is a disservice.
The use of the word "strategy" in the catalog bothers me too: another reviewer here suggested calling them "implementation variations." I favor "tactic," or choosing an approach to a more general directive by taking into account lower-level tensions in a problem domain. One example that might influence a tactic without changing a strategy: "We may not develop new tag libraries," or "we must remain open to migrating to declarative security." The book uses the term strategy consistently, and that may be an implied defense of it, but someone with expectations about what "patterns" are supposed to be has a right to feel a bit miffed.
That said, this book has several fine lists of bad practices and refactorings to bring existing code into a best practice. I think the book is best used by someone who has identified these problems in an implementation that didn't quite get the intent of J2EE architecture. This book will help clean up fuzzy or naive implementations, as well as help institute better practices for future development.
The authors do a fine job of reducing each of their design solutions to short problem statements most people can memorize. And that's the idea: when a designer hears a customer say, "our logging and auditing code is written across all of our web apps," the idea of a Front Controller or perhaps Intercepting Filter should come immediately to mind. As the designer learns more about strategies employed in the existing architecture, the tactics that best fit with their practice should come to mind, and so on. This is the power of conveying ideas quickly and clearly that we're all looking for.
- Reviewed in the United States on February 13, 2015As expected
- Reviewed in the United States on March 30, 2003After being tempted at java.sun.com with online version, I figured I would pick this book up to have as a good reference. After all, there's something to be said for having it in print =)
Unfortunately, I found the examples *severely* lacking. I returned the book practically immediately when I realized that it didn't fit my learning style. Much like the author of another book on design I own, MEGO (My Eyes Glaze Over) until I see a good example. I understand the patterns, but I would really have liked to have seen at least a *toy* example.
Imagine reading GoF and seeing this:
+++
Command pattern is blah blah blah. Here's an example:
Command comm = getCommand();
comm.execute();
+++
That example really wouldn't tell you how the Command pattern works in context, etc. At the end of each pattern in GoF, there's a really nice example (not in Java, but hey, no one's perfect ;) If this book had that, or at least a pointer inside of a larger example, THAT would have been it for me. I would have given it 5 stars.
What they COULD have done was said, "Here's what a Front Controller is. See x.java and y.java inside of PetStore or Adventure for a really good example."
The funny thing is that most of the example code is taken up by servlet overhead. Everything calls doProcess, etc. I don't need to see that code 10x.
As it stands, I'm giving it a '1' because the examples are so poorly done as to make the book practically worthless to me. I know I don't speak for everyone considering the rave reviews this book has gotten, but it certainly was not a match for my particular learning style.
- Reviewed in the United States on August 29, 2001I was really disappointed in the book because I wanted to get the source code. I had expected to get some more useful tools. A major part of this book is already on the java.sun.com website. A real waste of money if you are already familiar with design patterns and have gone to the java.sun.com website and seen these design patterns explained there.
Top reviews from other countries
- Andrew JohnstonReviewed in the United Kingdom on April 5, 2002
4.0 out of 5 stars A good book, but with a shorter book trying to get out.
I'll be honest, I was really was looking for a book called something like "Enterprise Java for an Architect who knows a lot about Microsoft DNA but not much about Java". This is the closest I've found. It is a very good presentation of how the different elements of the J2EE stack are meant to fit together, common problems and patterns which address them.
There are some very good things about this book. It really tries to explain the design forces which lead to good and bad solutions, and does try to put all the different patterns into the context of a "roadmap" so you can see how they link together. One of the best ideas in the book is actually in the epilogue, where the authors introduce the idea of building an architecture via a UML diagram built from stereotypes for the patterns. I can see this being widely adopted as a useful technique.
The big problem with the book is it is dreadfully repetitive. It's not sure whether it's a textbook, a reference book or a design tutorial, so it tries to be all three. The same text gets repeated over and over again, not only between sections but even within a section. By attempting to make each pattern, and each "strategy" within a pattern self-sufficient there's an awful lot of repeated text, sometimes even on one page. Some patterns almost exact copies of one another and should arguably be strategies for a single pattern. Text is often repeated between the "Problem", "Forces" and other sections of the same pattern, where a better trade-off would be references to a single list of more detailed descriptions. At the same time there are too many self-references in the text, even back to the start of the same section!
I found the repetition and overlap between the "design considerations", "bad practices" and "refactoring" sections confusing - it would be better if they all formed part of a single roadmap with the main set of patterns. There's an established concept of "Anti-patterns", which could easily serve for bad practices and refactoring ideas, and these could also be reflected as part of the "forces" for the patterns.
Adopting all of these patterns could lead to a very complex layer structure, with a great many classes involved in the simplest task. Several patterns seem to be about wrapping the complexities of J2EE, and you wonder whether there ought to be a more systematic solution to this. The book doesn't discuss "managing complexity in the design", but if it did it might come up with some simplifications.
While I'm not aware of an equivalent book with a Microsoft focus, with a little effort you could also apply many of these patterns in the Microsoft world. However, there are some good Visual Basic patterns books which show how this should have been written. A provocative idea - does the difference between this and equivalent VB books reflect the difference in productivity of the languages?
My advice? If you need a good J2EE design pattern reference buy this book, but don't try to read it cover to cover...