What does persistence mean? Why persist?

Source: Internet
Author: User
Tags access database

1. Application Hierarchy Evolution

There should have been a diagram describing the evolution of the application structure, but csdn can't upload it here, so it didn't come up.
Throughout the decades of the evolution of computer applications software, the application gradually evolved from a single-layer architecture to a multi-layered architecture. The original application software was just a single-tier application on a mainframe, most of which used file systems to store data. In the the 1970s, with the popularization of the database, the original single-layer structure was developed into double structure. In the double-layer structure, the separation of data storage and application is realized. However, the code that is responsible for user interface interaction is mixed with business logic, and a small system can still be maintained but for enterprise applications, long-term maintenance is a very difficult thing. As a result, the three-tier architecture emerged. In the three-tier structure, the original application layer is divided into the view layer and the business logic layer, and the database layer remains unchanged. With the rapid development of the software industry, people feel that such a frequent operation of the database and a large number of repetitive writing of the underlying code is a great waste of the program staff's painstaking efforts, hibernate,spring, and other frameworks came into being.
In Hibernate, the original business logic layer is divided into the business logic layer and the persistence layer. (now the mainstream hierarchy is still a three-storey structure).
2. What is persistence? Why do you want to persist?

1. What is persistence.

I found a lot of articles are not satisfied with the answer, and finally from Sun Weichen wrote "Proficient Hibernate:java object Persistence technology detailed", see the following explanations, feeling is relatively complete. Excerpt as follows:
Narrow understanding: "persistence" refers only to the permanent preservation of domain objects in the database; in broad sense, "persistence" includes various operations related to the database.
Save: Permanently save the domain object to the database.
Update: Updates the state of the domain object in the database.
Delete: Deletes a domain object from the database.
Load: Loads a domain object from the database into memory, depending on the specific OID.
Query: Depending on the specific query criteria, one or more domain objects that meet the query criteria are loaded from the database.
2. Why to persist.

Persistence technology encapsulates the details of data access and provides an object-oriented API for most business logic.
The persistence technology can reduce the number of Access database data and increase the speed of application execution.
Code reusability is high, can do most of the database operations;
Loosely coupled, so that persistence does not depend on the underlying database and upper-level business logic implementations, and changing the database requires only modifying the configuration file without modifying the code.

Reference documents:
1. What does persistence mean? Why persist?

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.