Advantages and disadvantages of using EntityBean and JDO in J2EE

Source: Internet
Author: User
Entity bean:
Provides robust data persistence. Bean containers process most of the data integrity, resource management, and concurrency features, allowing developers to focus on business logic and data processing, rather than these low-level details. When bean Managed Persistence (BMP) object Bean is used, developers write the Persistence code and the container determines when to execute the code. When the Container manages the Persistence (CMP) Entity bean, the Container generates the Persistence code and manages the Persistence logic.

JDO: only provides object-oriented Persistent data storage. Developers use POJO (non-formatted common Java object, plain ordinary Java object) to load and store persistent data.

Entity beans have the following advantages:
1) standardization. The EJB specification defines a set of interfaces unrelated to the supplier. The J2EE supplier can implement these interfaces to support the Entity bean. This standardization allows development with best practices and shortens the adaptation period when new developers are hired. As we all know the basic component architecture and design patterns, it is easy to find qualified personnel to implement them.

2) services managed by containers. As we discussed in the first two articles in this series, the EJB container management service provides great benefits for enterprise functions such as security, transaction processing, connection sharing, and resource management.

3) transparent persistence. The container can automatically manage persistent semantics during CMP. Although when using BMP object beans, developers must write persistence logic, while containers determine when to call methods defined by developers. When both CMP and BMP are used, the container determines when to continuously maintain the bean state and how to ensure data integrity and concurrency with the underlying data storage.

4) transaction support. Developers have coarse-grained control over CMP transactions (isolation level, transaction requirements, and methods) and fine-grained control over BMP transactions, these controls are implemented by processing the transaction semantics in the bean code as a program. In both cases, the container manages the transaction and determines whether the given transaction should be committed.

5) component-based design. Entity beans are designed as self-contained components. These components are configured with deployment descriptors and can be deployed to any J2EE application server without any code changes.

In short, the advantage of Entity bean is that it can benefit from standardization and industry best practices, simplifying some of the complexity of enterprise development.
The disadvantage is:
1) complicated design.

2) due to the complexity of enterprise beans and (especially) entity beans, one iteration (design/build/test/integration/test/deployment) the time spent may be much longer than other Java persistence solutions.

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.