What is persistence?

Source: Internet
Author: User

1. ApplicationProgramHierarchy Evolution
Here we should have a diagram describing the evolution of the application structure, but csdn cannot upload it here, so it is not uploaded.
Throughout the evolution of computer application software over the past few decades, applications have gradually evolved from a single-tier architecture to a multi-tier architecture. Initially, the application software was only a single-layer application on the mainframe, and most of the applications used file systems to store data. In 1970s, With the popularization of databases, the original single-layer structure developed into a double-layer structure. In the double-layer structure, data storage is separated from applications. HoweverCodeIn combination with business logic, a small system can still be maintained, but long-term maintenance for enterprise applications is very difficult. Therefore, the three-tier architecture came into being. In the layer-3 structure, the original application layer is divided into the view layer, the business logic layer, and the database layer. With the rapid development of the software industry, people feel that such frequent database operations and repeated writing of a large number of underlying code greatly waste the effort of programmers, hibernate, spring, and so on.

In hibernate, the original business logic layer is divided into the business logic layer and the persistent layer. (Currently, the mainstream layered structure is still a three-tier structure ).
2. What is persistence? Why persistence?

1. What is persistence?
I have found manyArticleI did not find a satisfactory answer. Finally, I found the following explanation in "proficient in hibernate: Java object persistence technology explanation" written by Sun weiqin. I still feel quite complete. The excerpt is as follows:

Narrow understanding: "persistence" only refers to permanent storage of domain objects to the database. In a broad sense, "persistence" includes database-related operations.

● Save: Permanently Save the domain object to the database.

● Update: updates the status of domain objects in the database.

● Delete: delete a domain object from the database.

● Load: loads a domain object from the database to the memory based on a specific oid.

● Query: loads one or more domain objects that meet the query conditions from the database based on specific query conditions.

2. Why persistence?
The persistence technology encapsulates data access details and provides object-oriented APIs for most business logic.

● The Persistence technology can reduce the number of accesses to database data and increase the application execution speed;

● High code reusability, able to complete most database operations;

● Loose coupling makes persistence independent of the underlying database and upper-layer business logic. When changing a database, you only need to modify the configuration file instead of the Code.

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.