Whether we need ORM (3)-Advantages and Disadvantages of ORM, why is Orm born, Orm and DB helper Library

Source: Internet
Author: User
Then write the above.

Advantages and disadvantages of ORM:

Advantage: since the concept of ORM was proposed, it has received numerous responses, and a wide range of application frameworks are overwhelmed. Obviously, he has his own unique advantages. What are their advantages:

First, the biggest advantage of ORM.
Hiding data access details, "closed" Universal Database interaction, and the core of ORM. It makes the interaction between our general databases easy and easy, and does not need to consider damn SQL statements at all. Rapid development.

Second: Orm makes it easy to construct a solid data structure.
In the prehistoric era of ORM, we need to convert our object model into an SQL statement, and construct our database system in relational database through direct connection or DB helper. Currently, basically all ORM frameworks provide the ability to construct a relational database structure through an object model. This is quite good.

Disadvantages:
First:
Inevitably, automation means ing and association management at the cost of sacrificing performance (early on, this is what all people do not like ORM ). Currently, various ORM frameworks are trying to use various methods to reduce this (lazyload, cache). The effect is quite remarkable.

Second:
As a kind of transition between the database and the object, the Object-Oriented Query Language (X-QL) hides the business abstraction at the data layer, but it cannot completely shield the design of the database layer, and will undoubtedly increase the learning cost.

Third:
For complex queries, Orm is still insufficient. Although it can be implemented, it is not worth it. The view can solve most of calculated columns, Case, group, having, order by, exists, but the query condition (A and B and not C and (D or D ))......

There are no donkeys in the world that don't eat grass (think well, think well, and think well, buy an old donkey and don't eat grass). There are flaws hidden behind any advantages, which is inevitable. The question is whether we can tolerate shortcomings. ADACodeAlthough the ease of use is poor, US. DOD (the Department of Defense) appreciates his computation speed;. NET platform is good, but he is ms. Pai_^

Why is Orm born?

Several months ago, I had the honor to attend a component release within the company. I am deeply surprised that the component press conference, which has always been unattended, has become quite crowded this time, after a long introduction of the new version. Every development leader jumps out to complain about the problem of the previous version, and the announcement and the new version cannot meet their needs. Everything is so chaotic that the leadership has to suppress people in full swing.
On the evening after the meeting, I thought about the conflict. As far as I know, this series of components perfectly fulfill the functions he was expected to do. But why is it still complained.
I think it is possible that the component is not correctly used.

I don't know who else remembersJames ElliottThat sentence,

As good object-oriented developers got tired of thisRepetitive work,Their typical tendency towards enlightened laziness started to manifest itself in the creation of tools to help automate the process. When working with relational databases, the culmination of such efforts were object/relational mapping tools.

The ORM architecture can only be a helper, which is located with this, rather than the complete data persistence layer. His designers never positioned him as a super beauty to replace everything. Orm is committedProgramThe war between personnel and "repetitive work" helps. Like any helper, he has his own shortcomings. He has both advantages and disadvantages.
Countless developers tried to use the orm framework to construct the data persistence layer of their own projects. Many people felt the advantages of ORM, and they were excited. However, unfortunately, many people fail or are deeply held accountable.
There are still many people who are helpless to write a lot of tasks that ORM is not suitable for cooperation. In fact, do you really have nothing to do with the previous helper tool abandoned by yourself?

Orm and DB helper Library:

Many people may have access to such helper, and every company has its own helper. Many helper provides many powerful functions, including closed interaction underlying layer, entity class support, and SQL translation. Orm provides only one layer more than helper. It tries to implement association through closed automation (or ing files. In the past, this was all our hands. (Flexible replacement of databases is also an ORM advantage ,)
The problem is that some people find closed automated associations to meet their needs, so ORM is successful for them. Some people find that closed automatic associations are not suitable for their projects, so ORM is criticized.
Here, I don't want to say more. This is the end.

My point is that ORM is trying to replace helper, providing more features. He is constantly developing to cope with more stringent and complex enterprise needs. In many cases, these tools are beginning to have their own complexity, so developers must learn to use their detailed rules, and modify the classes that make up the application to meet the needs of the ing system. The complexity of using these classes overwrites the benefits that can be gained. In most of our projects, helper is still the main force for us to build a data persistence layer. Orm may be able to do everything in some projects (modules), but ORM (for now) we cannot face all the challenges.

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.