Enterprise JavaBeans v3.0-Foreword

Source: Internet
Author: User
Tags jboss application server

Foreword

Enterprise JavaBeans is the core component technology of the Java Enterprise Edition platform. it is an enterprise infrastructure designed to provide developers with the automatic management of the services essential to enterprise applications. the EJB containerthe immediate environment of enterprise bean components and the provider of managed services to themis at the center of this architecture.

However, to use this managed environment in earlier versions of EJB, developers had to write to APIs that focused more on the EJB container's requirements than on the business logic of enterprise applications. consequently, EJB development was unnecessarily complex. for example:

Implementation of various EJB interfaces led to a lot of boilerplate (sample file) code for methods that were required by the interface, but not needed by the application.

An XML deployment descriptor was required to integrate the application with its environment and with container services. Access to the components' environment was clumsy and nonintuitive.

The Design of container-managed persistence made domain object modeling unnecessarily complex and heavyweight. while container-managed persistence was originally conceived as an example-of-use facility, in practice, it was awkward and limiting.

The purpose of the EJB 3.0 release was to refocus EJB on simplifying the developer's tasksand to fix all of these problems, and more.

One of the first steps in this process was evaluating the sources of complexity in the earlier EJB releases. this involved examining failed of EJB; understanding which EJB design patterns were really antipatterns; identifying APIs that were clumsy to use, were nonintuitive to newcomers to the technology, or cocould be dispensed with entirely; and recognizing other aspects of the technology that were obstacles to limit of use.

The preliminary list of what needed to be fixed together with a proposal for how the task cocould be approached formed the basis of JSR 220, the Java Community Process specification request with which I launched EJB 3.0. starting with the initial list of the APIs that needed improvement, the EJB 3.0 Expert Group undertook the process of brainstorming on better, simpler constructs.Bill Burke, The chief effecect of the JBoss application server and author of this book, was one of the key particles in this effort.

The Expert Group's work has resulted in a major simplification and improvement. all of the key EJB APIs are easier to use, and the configuration-by-exception approach of ejbs 3.0 allows developers to rely on expected default behaviors.The XML deployment descriptor has become unnecessary, Could t for addressing more advanced cases.

The Java language metadata facility, newly added to Java SE, aided us in making these simplifications. EJB 3.0 uses metadata annotations to express within Java code the dependencies of EJB components upon container services, and thus to avoid the need to provide a deployment descriptor.Further, ejbs 3.0 provides default values for metadata so that in general, this metadata can be sparse(Sparse and sparse ).

By using metadata annotations to designate environment dependencies and life cycle callbacks, ejbs 3.0 has also been able to eliminate the requirement for the Bean class to implement to the incluisebean interfaces. A bean class can now selectively specify what it needs, and can implement only needed methods rather than unnecessary boilerplate code.

We were ableEliminate the earlier EJBHome factory patternsAs well by requiring smarter interpositioning on the part of the container (transparently to the Application) in creating references to components and their instances at the time of lookup or injection.Session beans can now be programmed as ordinary Java classes with ordinary business interfaces, rather than as heavyweight components.

These and other changes have greatly simplified the developer view. Further, they leave the underlying EJB architecture fundamentally unchanged, providing a migration path to ejbs 3.0.

The simplification of container-managed persistence provided a greater challenge. we began the effort here with the same steps as the simplification of session beans and message-driven beans: elimination of unneeded interfaces, use of annotations annotation for configuration information, and so on. it soon became clear, however, that EJB persistence needed a more radical (adj. fundamental, basic, and radical) transformation. further, the success of lighter-weight object/relational mapping technologies such as Hibernate gave clear guidance to the direction that this transformation shoshould take.

As described in this book, the resulting Java Persistence API replacesContainer-managed persistence with a lighter-weight, Plain Old Java Object (POJO) persistence layer. This layer provides extensive support for domain object modeling, including inheritance and polymorphism; numerous enhancements to the ejb ql query language to provide rich query capabilities; and a specification for portable (adj. lightweight, portable, and portable object/relational mapping through use of annotations or an XML descriptor. persistent entities are now instances of ordinary (but managed) Java classes. as such, they can be created with new and passed to other application tiers as ordinary Java objects. the managed persistence contexts provided by the Java Persistence API provide particle leverage within EJB 3.0 environments, and enable the easy modeling of extended client "conversations."

Because of the scope of this work, ejbs 3.0 has greatly simplified enterprise application development, and percent of the features it has introduced have been inconfigurated elsewhere in the Java EE platform. Beyond this,The Java Persistence API has been expanded to support use "outside the container" in Java SE environments.

Bill Burke's contributions to ejbs 3.0 and the Java Persistence API have been numerous and far reaching. as chief impact ect for the JBoss application server, he brought to the EJB 3.0 Expert Group key insights on container innovations, extensive experience with the Hibernate object/relational persistence technology, and a broad perspective on the needs of developers and their use of the EJB technology in real-world applications. in this new edition of Enterprise JavaBeans, based on the earlier work by Richard Monson-Haefel, Bill Burke shares these insights together with his in-depth perspective on how these new, simplified EJB 3.0 APIs transform the enterprise Java landscape for application developers.

  Linda DeMichiel EJB 3.0 effecect and Specification Lead Sun Microsystems Santa Clara, California 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.