正在加载图片...
CHAPTER 1 ■■■ Introduction to the EJB Architecture When we set out to write this book,our goal was to present Enterprise JavaBeans(EJB)to developers,with a keer can be used in e hardcore power users alike.That's a large audience to satisfy and,as a reference guide,the EJB spec document covers it well.In writing a book about how to use EJB,we had to narrow our audience;nonetheless,we believe that we've written a book that will serve the needs of a majority of Java EE developers. This book is targeted at developers who are experienced with Java,have built single-or multi-tier applications using earlier versions of EJB or other technologies,and are ready to take on the challenges(and rewards)of building enterprise applications using standards-based technology.Recognizing that a combined 1,100 pages of reference material [covering the EJB and Java Persistence API(JPA)specs]can be daunting,we ha developers,unfolding EJB one section at a time,and giving you the information and code examples you need to roll. spec,but you will also lea arn throug out ho applicay of the co yo see hov ho fit int a bigger pict e.You ar ama2edoaew and ith ther th y the related APIs covered in this Web Services.and Contexts and Dependency miecti ion (CDD offer a lot with which to work.Once you're comfortable with the basics of building deploying and testing,you'll find that EJB components are not only po werful but also easy to build and use Together,the authors of this book have built a number of applications using EJB in concert with other technologies in the Java EE stack,and we have attempted to capture within it advice about the practical patterns we have learned,the strategies we have found successful,and some pitfalls you can avoid.Most chapters in this book are dedicated to exploring specific areas of EJB,but we have also included chapters on Java Persistence API(JPA). Contexts and Dependency Injection(CDI),Web Services,gauging the performance of your EJB applications,and deploying to the Java EE application server of your choice.An introductory"Getting Started"section at the end of this chapter will get you set up to run the many useful sample applications found at the end of each chapter in the book We hope this b ok will serve not only as a reference guide for information on EJB but also as a how-to guide and repository of practical examples to which you can refer back as you build your own applications.Enjoy! An Introduction to EJB In the late 1990s,as Java was bolstered by the emergence of separate technologies(such as RMI,TA,and CORBA)that ologies and o Over the ngyears,El as ev Ito encomp (while ju nd standa for deploying and executing business components n a distributed,multiuser environme 1 Chapter 1 Introduction to the EJB Architecture When we set out to write this book, our goal was to present Enterprise JavaBeans (EJB) to developers, with a keen eye toward how this technology can be used in everyday, real-world applications. JSR-345: Enterprise JavaBeansTM, Version 3.2 EJB Core Contracts and Requirements is a deep spec that addresses the needs of beginning developers and hardcore power users alike. That’s a large audience to satisfy and, as a reference guide, the EJB spec document covers it well. In writing a book about how to use EJB, we had to narrow our audience; nonetheless, we believe that we’ve written a book that will serve the needs of a majority of Java EE developers. This book is targeted at developers who are experienced with Java, have built single- or multi-tier applications using earlier versions of EJB or other technologies, and are ready to take on the challenges (and rewards) of building enterprise applications using standards-based technology. Recognizing that a combined 1,100 pages of reference material [covering the EJB and Java Persistence API (JPA) specs] can be daunting, we have provided an on-ramp for developers, unfolding EJB one section at a time, and giving you the information and code examples you need to roll up your sleeves and get to work. As each chapter unfolds, you will not only learn about a new area of the spec, but you will also learn through specific examples about how to apply it to your own applications. Many of these examples come directly from the comprehensive, end-to-end, Java EE Enterprise Wines Online application constructed in Chapter 7 and Chapter 12, so that you can see how they fit into a bigger picture. You are encouraged to take these examples and run with them. Try them out in your favorite IDE or development environment, and change them around and try new things. EJB and the related APIs covered in this book—JPA, Web Services, and Contexts and Dependency Injection (CDI)—offer you a lot with which to work. Once you’re comfortable with the basics of building, deploying, and testing, you’ll find that EJB components are not only powerful, but also easy to build and use. Together, the authors of this book have built a number of applications using EJB in concert with other technologies in the Java EE stack, and we have attempted to capture within it advice about the practical patterns we have learned, the strategies we have found successful, and some pitfalls you can avoid. Most chapters in this book are dedicated to exploring specific areas of EJB, but we have also included chapters on Java Persistence API (JPA), Contexts and Dependency Injection (CDI), Web Services, gauging the performance of your EJB applications, and deploying to the Java EE application server of your choice. An introductory “Getting Started” section at the end of this chapter will get you set up to run the many useful sample applications found at the end of each chapter in the book. We hope this book will serve not only as a reference guide for information on EJB but also as a how-to guide and repository of practical examples to which you can refer back as you build your own applications. Enjoy! An Introduction to EJB In the late 1990s, as Java was bolstered by the emergence of separate technologies (such as RMI, JTA, and CORBA) that addressed the enterprise needs of large-scale applications, a need arose for a business component framework that could unify these technologies and incorporate them under a standard component development model. EJB was born to fill this need. Over the ensuing years, EJB has evolved to encompass numerous features (while judiciously rejecting others), and it has matured into a robust and standard framework for deploying and executing business components in a distributed, multiuser environment
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有