Object relationship Technology

Source: Internet
Author: User
This is a very old problem. I often see on the forum that many people have written related questions. Article . I have a lot of experience in this area. Let me also talk about my views.

I once achieved Kingdee EAS Bos multi-data support engine, script engine, also made O-R mapping pre-research work, once on multiple O-R mapping products have done research.

C ++, Java, and C # Are all sourced from Algol. These languages are also called imperative languages. The imperative language is based on the noriman system structure,ProgramPersonnel must handle variable management and variable replication. This result increases the execution efficiency, but brings difficulties in program development.

LISP, schema, Haskell, and other languages are functional languages. Functional Languages are based on mathematical functions and do not use variables or value assignment statements to generate results, use the application, condition representation, and recursion of functions as execution control. Functional language is a more advanced programming language, which is less written than imperative language.CodeHigher development efficiency, which is a bit clear about functional languages. Many programming technologies are first applied to functional languages, such as pattern and garbage collection. Many functional languages add some imperative language features to increase efficiency and ease of use.

SQL is a specialized language in the field used to process relational data. He has features of some functional languages and is very intuitive and informative in terms of processing relational data. It is much easier to process operations such as selection, projection, aggregation, and sorting than in Java or C. SQL is also easy to learn and use. Many non-programmers are familiar with SQL. In Kingdee, most demand personnel are familiar with SQL. The interpretation of SQL requires a certain amount of performance consumption. In the case of extreme performance requirements, relational databases are usually not used. For example, Google accounts use Berkeley dB.

Now, relational databases have developed very mature, and some technologies of databases have developed very well, including transactions. Some technologies developed from databases have also been applied to the operating system. In the past few years, when object-oriented technology went viral, I did a lot of research on object-oriented databases, but none of them achieved great success. Most mainstream relational databases include object-oriented support, such as Oracle and Sybase, which have rich object-oriented functions, but are rarely used.

Now someone tells me about db4o databases. I don't think db4o will succeed because he is in the wrong direction.

Currently, relational databases are the most popular. The most popular application development languages include Java and C #. They are all object-oriented imperative languages. The development language needs to access the relational database, need to switch, the process of conversion is more complicated, so the birth of the O-R ing technology. This is a compromise, and object-oriented technology cannot succeed in the database field. In object-oriented development languages, an object-relational ing technology is required. I believe that this kind of compromise technology will become increasingly popular.

I also think this is a correct choice. For example, a high-level language does not try to replace assembly. No matter how good a high-level language is, an abstract layer can be added to it at most. For example, Java uses bytecode and C # Use Il to use an abstraction layer instead of trying to replace assembly.

In addition to simple ing, O-R mapping technology requires a kind of oql, hybrid SQL and object-oriented features to provide convenient ing while retaining the strong functionality of relational databases. For example, relational operations such as aggregation and sorting must be provided in oql. Because the returned results in the program sometimes do not need to be mapped to an object, oql must provide another function, data query. Many O-R mappping products provide object-based oql and data-based oql.

This includes three parts:
1. Applications Use oql
2. O-R mapping interpretation or compilation of oql
3. The object database is responsible for data processing

If O-R mapping processes oql in interpreted ways, operations such as generating SQL and assembling objects are included. Efficiency is usually not very good, the current O-R mapping products are basically based on the interpretation of the way to deal.

If the O-R mapping uses the compilation method, can optimize the generation of SQL, dynamic creation of SQL stored procedures, reduce the SQL interaction process, can obtain good performance, can achieve than the absolute
Most people directly use SQL to achieve better performance. I once made an experimental implementation and achieved very good results. Unfortunately, for various reasons, I did not continue.

I think that the next generation of O-R mapping products will adopt the compilation method, because in many cases, especially the processing of complex objects, can have a substantial performance improvement, in some scenarios, performance can be improved by several or even dozens of times.

I have never been very optimistic about hibernate, because the main author Gavin does not understand the compilation technology. 2. the hql Syntax of Version X is funny, and the implementation is also funny. Simple text replacement makes people stunned. After 3.0, the AST (Abstract syntax tree) of hql was added, but this was not his own work. Other fans joined the process and 3.1 was not well integrated. I will not continue to pay attention to later versions.

I think O-R mapping is completely a compilation technology, and people who do not understand the compilation technology will always be wrong in doing this. This is not only the problem of hibernate, but also the problem of other O-R mapping products.

My point of view:
1. Java, C #, C ++ and other languages have no advantages in processing relational data. SQL is a specialized language (DSL) for relational data processing. It is more suitable for processing relational data and provides powerful functions.
2, relational data is the mainstream, hope application developers use O-R ing, but do not understand relational database, this is unrealistic.
3, O-R mapping technology has a great space for development, in the future in the function, performance and other aspects will have a major improvement, the final maturity.

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.