What is the advantages of using EntityBean and JDO in J2EE?

xiaoxiao2021-03-06  47

Entity Bean:

Provide robust data persistence. The BEAN container handles most of the data integrity, resource management, and concurrency, so that developers pay attention to business logic and data processing, not these low-level details. When using bean management persistence (BMP) entity bean, developers write persistent code and the container determines when the code is executed. When container management persistence (CMP) entity bean, the container generates persistence code and manages persistence logic.

JDO: just provides object-oriented persistent data storage. Developers use Pojo (unformatted ordinary Java objects, Plain ORDINARY JAVA Object) to load and store persistent data.

The entity beans mainly have the following advantages:

1) Standardize. The EJB specification defines a set of interfaces unrelated to the supplier, and the J2EE vendor can implement these interfaces to support entity beans. This standardization allows for the development of best practices and shortening the adaptation period when employing new developers. Because basic component architecture and design patterns know, it is easy to find qualified talents to achieve them.

2) The service of container management. As we discussed in the first two articles of this series, EJB container management services provide great benefits to handle corporate functions such as security, transaction, connection and resource management.

3) Transparent persistence. CMP When the container automatically manages persistence semantics. Although the developer must write persistence logic when using BMP entity bean, and the container determines when to call the method defined by the developer. At the same time, when using CMP and BMP entity beans, the container determines when to keep the bean state and how to ensure data integrity and concurrency in the underlying data.

4) Transaction support. Developers have coarse-grained control for CMP transactions (including / excluding / excluding) of the Isolation level, transactional needs, and methods. These controls have fine-grained control over BMP transactions. These controls are processed in the BEAN code. Implemented. In both cases, the container management transaction and determines if a given transaction should be submitted.

5) Based on the component design. Entity beans are designed to include components that are configured with deployment descriptors, which can be deployed to any J2EE application server without changing any code.

In short, the advantage of entity bean is that it can benefit from standardization and industry best practices, and simplify certain complexities developed.

Disadvantages are:

1) Design complex.

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

3) Response time is not ideal

4) The resource takes up high, always consumes a lot of server resources.

Compared to Entity Bean,

The advantages of JDO are:

1) Simple design.

2) Fine-grained control, allowing developers to fully control the entire persistence process, including cache, persistence, and synchronization, etc.

3) Simple coding. The JDO architecture hides the developer's low-level persistence details.

转载请注明原文地址:https://www.9cbs.com/read-76267.html

New Post(0)