Analysis on persistent object technology of EJB-JSP tutorial, object-oriented/Design
Source: Internet
Author: User
From Changjiu College
The problem of ing between table-based relational databases and tree-type Java objects is an issue that is constantly debated. Fortunately, there are already some good solutions. In this article, we will introduce how the EJB technology solves this problem in a specific way.
As long as it involves saving and querying information, most applications need to deal with relational databases. However, due to the essential difference between the structure of relational databases and Java objects, the ing between them is a headache for Java developers. Relational databases store data in tables, while Java objects store data in a tree. This type of mismatch leads to a variety of object persistence solutions to narrow the gap between the relational world and the object world. The EJB framework is one of these solutions.
Object persistence
Currently, there are many different tools that allow developers to convert JAVA objects to fields or records in the database, or restore fields or records in the database to JAVA objects. These operations involve serialization of tree-type JAVA objects to the database, and vice versa. The core of this work is how to complete the work with minimum performance loss.
The EJB framework provides such an object persistence mechanism. We will discuss this mechanism in this article, but first we will give a comprehensive understanding of the EJB architecture.
Enterprise-level JavaBeans (EJB)
The EJB technology can be defined as follows: it is a reusable component framework provided for distributed applications based on the JAVA server. All business logic, deployment definition, and object persistence are managed by this framework. The EJB framework has the following features:
· EJB is a JAVA Object running in the server environment.
· EJB can be remotely accessed on different machines, but it is as convenient to call EJBs as to call local JavaBean.
· The EJB container manages EJBs in a unified manner.
Although the names of enterprise-level JavaBean are similar to those of ordinary JavaBean, they are essentially different in design. To make you more aware of this, we 'd better first understand the basic concepts of EJB, several EJB component modes, and their configuration environment.
EJB running environment
In essence, EJB only implements common JAVA objects for specific interfaces, but this object must run in a specific environment: EJB container. If you leave the EJB container, EJB cannot run. The relationship between EJBs and EJB containers is sometimes called "reverse call"
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.