J2EE Core Patterns (Second Edition)

Author: (USA) Alur (Alur, Deepak.) et al. (Authored by), Liu Tianbei et al. (Translated by)
Publisher:
Publishing Time:
Features: "The Java landscape is littered with various libraries, tools, and technology specifications. What is lacking is the professional ability to integrate these elements and solve real-world problems. The patterns in this book have become the smart cement in the construction process of J2EE software." — John Vlissides, one of the authors of "Design Patterns." "The authors of "J2EE Core Patterns" have extracted a set of truly practical patterns. They introduce how to apply these patterns and how to refactor your system to benefit from them. It's like having an expert group sitting next to you." — Grady Booch, Chief Scientist at Rational Software "The authors have introduced a large number of patterns that are extremely helpful for application architecture. This is an amazing work. Just the 'Refactoring' section alone is worth the price of the entire book!" — Craig McClanahan, Chief Architect of Struts, and Head of the JavaServer Faces Technology Specification Group Developers often confuse "learning a technology" with "learning to design with that technology." In this book, senior architects from Sun Java Center share their years of experience in designing with J2EE technology. The main focus of this book is on using J2EE core technologies—including JSPTM, Servlet, EJBTM, and JMSTMAPI—to implement patterns, best practices, design strategies, and proven solutions in enterprise applications. The J2EE Patterns Catalog includes 21 patterns and a large number of strategies to help document and promote the best practices of using these technologies. Preface Since the first edition of this book was published, we have received a lot of feedback on the initial 15 patterns. In recent years, the activity on the J2EE Patterns Community Catalog Server (JPCLS) has been very active and successful, with many insightful discussions every day. During this time, we have also worked on several important large-scale J2EE architecture design and development projects with our clients. Incorporating the experience and feedback from this period into the revision of existing patterns and the documentation of new patterns has indeed been a laborious and challenging process. We have paid special attention to the most frequently mentioned feedback: support for J2EE technology specifications and the new version of Web Services. We have completely revised and updated the initial 15 patterns to cover the J2EE technology specification version 1.4. We have added many new strategies to these initial patterns. Additionally, we have documented 6 new patterns to improve the pattern language and provide better conceptual abstractions for building, understanding, and using J2EE frameworks. Although each of these patterns is highly practical on its own, we believe they are even more powerful when combined to solve large-scale problems. Therefore, in this new edition, we have introduced a new area we are exploring, which we call "Microarchitecture." A "microarchitecture" is the building block for constructing applications and systems. Compared to the individual patterns listed in the catalog, this concept is a higher-level abstraction, often a set of interrelated patterns that address common recurring problems in application architecture. We are happy to use "microarchitecture" as a network of interrelated patterns, forming a ready-made solution for addressing larger-scale problems, such as subsystem design. This edition includes a microarchitecture called WebWorker. It addresses the problem of how a J2EE application can integrate with a workflow system. It specifically discusses the use of the system integration pattern to allow users in the workflow system to interact with the J2EE application. This book is about the patterns for the Java 2 Enterprise Edition (J2EE) platform. The J2EE patterns documented in this new edition of the book can be used to solve the design problems that developers often encounter when building applications on the J2EE platform. The patterns recorded in this catalog were discovered in real-world design scenarios, and it is because of their use that we have been able to create successful J2EE applications for our clients. This book describes many solutions that have been proven to work on the J2EE platform, with a particular emphasis on the following core J2EE technologies: JavaServer Pages (JSP), servlets, Enterprise JavaBeans (EJB) components, Java Message Service (JMS), JDBC, and Java Naming and Directory Interface (JNDI). For frequently recurring problems on the J2EE platform, we provide solutions through the J2EE Patterns Catalog and J2EE Refactoring. You can apply these ideas when developing new systems or improving the design of existing systems. The patterns recorded in this book will help you quickly become proficient in J2EE technology, enabling you to build robust and efficient enterprise applications. Today, as always, many of us naively believe that learning a technology is the same as learning to design with it. Of course, understanding the technology is one of the key elements for successful design with it. However, there are many Java books that provide excellent explanations of technical details (such as specific API usages), but they do not delve deeply into how to apply the technology. To learn design, you need practical design experience and the sharing of knowledge about best and worst practices with other developers. The experience conveyed in this book comes from our real-world work. We are part of Sun's Sun Java Center (SJC) consulting division. In our work, we often encounter situations where, due to the rapid development of technology, designers and developers are still struggling to understand the technology itself, leaving little time to understand how to design with it. Therefore, simply telling designers and developers how to write good code or suggesting that they use servlets and JSP for the presentation layer and EJB components for the business layer is not enough. So, in such cases, how can a dedicated J2EE architect not only learn "what to do" but also "what not to do"? What constitutes best practices? What are the worst practices? How do you complete the entire process from problem to design to implementation? Sun Java Center and the J2EE Patterns Catalog Since its inception, the architects at Sun Java Center have been collaborating with clients worldwide to successfully design, plan, build, and deploy various types of Java and J2EE-based systems. Sun Java Center is a rapidly growing consulting division, continuously recruiting new employees to join its experienced team of architects. Currently, there are a large number of proven designs and architectures, and it is a significant need in our industry to solidify this design experience and share it with others. We recognized this need early on and began documenting our J2EE platform experience in the form of patterns as early as 1999. Although we reviewed various existing literature, we couldn't find any pattern catalog specifically dedicated to J2EE platforms. There are many books that discuss one or more aspects of J2EE technology, providing excellent introductions to the technology and analyzing the subtle details of the technology specifications. We found that some of these books also offer design considerations, which are particularly beneficial. At the JavaOne conference in June 2000, we publicly presented our ideas on J2EE patterns for the first time. Since then, we have received a lot of enthusiastic feedback from architects and developers. Some of them expressed a strong willingness to learn more about patterns, while others said they had used these patterns but had not named or documented them. The interest shown in J2EE patterns encouraged us to do further work. Therefore, we compiled the J2EE Patterns Catalog, which was first published to the J2EE community via the Java Developers Conference (JDC) in March 2001 as a beta version. Based on a lot of feedback from the entire community, that beta version eventually evolved into the book you see today. We hope that these J2EE patterns, best practices, strategies, worst practices, and refactoring will benefit everyone. The scope of this book This book covers the following topics: Using patterns in the J2EE platform. Based on our experience in the J2EE platform, we have compiled the patterns catalog in this book. This J2EE Patterns Catalog describes the best practices for architecting and designing applications on the J2EE platform. This book focuses on the following J2EE technologies: servlets, JSP, EJB components, and JMS. Designing application systems that use servlets, JSP, EJB components, and JMS technologies. Learning the technology itself and its APIs is not enough; it is equally important to learn how to design with the technology. We have documented the best practices for using these technologies in our experience. Avoiding the "reinventing the wheel" in J2EE platform design and architecture. Patterns encourage design reuse. Reusing existing solutions can shorten the cycle of designing and developing applications—this certainly includes J2EE applications. Identifying poor practices in existing systems and using J2EE patterns to refactor these designs to form better solutions. Knowing what works is good, but knowing what doesn't work is equally important. We have documented some of the poor practices we encountered while designing J2EE applications in this book. This book does not cover the following topics: How to program using Java or J2EE technology This book is not about programming. Although much of the content is based on J2EE technology, we do not describe API details. If you want to learn Java programming or how to use any technology in J2EE, there are many excellent books and numerous online resources available as tutorials. If you want to learn a specific technology, we strongly recommend the various online tutorials on the Java official website at http://java.sun.com. The official J2EE technology specifications are also available on the Java homepage. Which development process and methodology to adopt We do not specifically recommend any particular development process or methodology, as the content of this book is not closely related to either. Therefore, this book does not teach any process or methodology that can be used to develop projects. If you want to learn about processes and methodologies, there are many books that discuss various object-oriented methodologies, and there are also many new books that cover lightweight processes like Extreme Programming. How to use the Unified Modeling Language (UML) This book will not teach you how to use UML. We have used UML extensively (especially class diagrams and sequence diagrams) to document patterns and describe static and dynamic interaction relationships. If you want to learn UML, refer to Grady Booch, Ivar Jacobson, and James Rumbaugh's "UML User Guide" [Booch] and "UML Reference Manual" [Rumbaugh]. Who should read this book This book is for anyone interested in J2EE, including programmers, architects, developers, and technical managers. In short, it is for anyone interested in designing, architecting, and developing applications on the J2EE platform. We aim to make this book a training guide for J2EE architects and designers. We believe that good design and well-architected projects are of great importance, so we need excellent architects to reach this level. For development teams with varying levels of skill, if we document patterns, best practices, and worst practices in detail to achieve knowledge and experience sharing within the team, this could be invaluable; we also hope this book can partially meet similar needs. The organization of this book This book is organized into two parts. Part Part "Patterns and J2EE" is an introduction to J2EE and patterns. It examines design considerations when developing JSP, servlets, and EJB. This part also includes J2EE platform poor practices and refactoring. Chapter 1, "Introduction," briefly discusses multiple topics, including patterns, the J2EE platform, the definition of patterns, and the categorization of patterns. It then introduces the J2EE Patterns Catalog. Chapter 2, "Presentation Layer Design Considerations and Poor Practices," and Chapter 3, "Business Layer Design Considerations and Poor Practices," discuss the design considerations and poor practices for the presentation layer and the business/integration layer, respectively. The design considerations here refer to the issues that a J2EE developer/designer/architect needs to consider when working on the J2EE platform. When reading the topics in these chapters, you can refer to other resources (such as official specifications and some excellent related books) to obtain detailed information on related topics. Chapter 4, "J2EE Refactoring," examines some refactoring that we encountered in our actual work, which also helped us improve designs that were initially not ideal. This refactoring also provides another perspective on the other content of this book, which we believe is a valuable supplement to the patterns catalog. This chapter reflects the influence of Martin Fowler and his book "Refactoring" [Fowler]. For readers familiar with "Refactoring," the form of this chapter should also be quite familiar. However, the content of this chapter is completely based on J2EE technology, while Martin Fowler examines refactoring at another level in his works. Second Part The second part, "J2EE Patterns Catalog," lists the J2EE Patterns Catalog. The patterns included in the catalog form the core content of this book. Chapter 5, "Overview of J2EE Patterns," is a review of the J2EE Patterns Catalog. This chapter explains how to use J2EE core technologies to implement patterns, best practices, design strategies, and proven solutions in enterprise applications, covering technologies such as JSP, servlets, EJB, and JMS. The J2EE Patterns Catalog includes 21 patterns and a large number of strategies to help readers quickly become proficient in J2EE technology, enabling them to build robust and efficient enterprise applications. This book is a reference for computer application developers, architects, technical managers, and others.

📌 Related Posts