DLinq Overview [1]

Source: Internet
Author: User

Currently, many developers process data stored in relational databases in one way or another. However, modern programming languages and databases are quite different in terms of Information Representation and processing. This inconsistency is manifested in many aspects. Most obviously, a text string is required to access database information using APIs provided by programming languages. In fact, these queries are part of the program logic, but they are not transparent in programming languages. Therefore, it is impossible to obtain the language compilation support and some features during design, such as intelliisensetm.

However, their inconsistencies are far from manifested in these aspects. The representation of neutral data models by programming languages and databases is different. Modern programming languages use objects. Relational databases use rows. The object instance is unique during running. The rows in the database table are uniquely identified by the primary key. Objects are associated by reference. A foreign key must be set for rows in the database table to be loosely associated with rows in other tables. Objects are unique. The lifecycle of an object depends on the object's reference status. The rows in the database are the basic elements of the table. Once they are removed from the table, they disappear immediately.

Undoubtedly, it is difficult to create and maintain any application that requires seamless integration of programming languages and databases. Of course, we can simplify this balance and discard one of the technologies. However, relational databases have already provided many key basic technologies for data storage and query processing. Modern programming languages are also essential for agile development and powerful computing.

So far, developers have tried to find a compromise and effective solution in their applications to solve this problem. Currently, the best solution is to establish a database abstraction layer between the application domain model and the relational database model, and realize data transmission between the two through data format and representation conversion. However, these solutions all cost at the expense of the most important features of relational databases (powerful data query capabilities), because they prevent application developers from directly accessing real data sources. A component in the LINQ project, DLinq, provides basic runtime support for managing relational data without sacrificing the powerful query capability of the database. During running, DLinq translates language-integrated queries into SQL statements for the database to execute, and then converts the data obtained from the database into objects of the specified type in the application. Applications can freely process these objects on the foreground, and DLinq automatically records these changes on the background.

One design goal of DLinq is to maximize compatibility with existing applications. DLinq is just ADO. one of the components in the NET family, ADO. NET and DLinq use the same database connection and transaction processing method. Therefore, you can incrementally add existing ADO.. NET solution to DLinq.

DLinq applications are easily built. Define relational data objects just like common objects. The difference is that these relational data objects require additional features to identify the ing between objects and rows. You don't even need to write the code manually. We provide such a tool to automatically convert the type definition from a relational database to an object.

The design tools and runtime infrastructure provided by DLinq can effectively reduce the workload of database program developers. The following sections describe how DLinq performs common database operations. We assume that the reader is familiar with language integration queries and standard query operators.

DLinq is neutral in programming languages. Any programming language supporting integrated query can use DLinq to access relational databases. Even so, all examples in this article are written in C #, and the Visual Basic compiler also supports LINQ.

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.