Also Talk About Typed Dataset

Source: Internet
Author: User
I have read truly's article about the test of Typed Dataset. Article For a moment, I want to talk about typed dataset from another angle.

I declare that this article only represents my humble opinion. If you have different opinions, please refute them directly.

What is typed dataset?

I don't know if it is necessary to raise this question. In fact, my earlier understanding of typed dataset is also ambiguous. In my words, it is "speaking with practice ". In general, vs. NET provides a method to create a typed dataset.CodeIt is huge, but it is enough. It is estimated that many people talk about Typed Dataset.

People who have read the duwamish7 source code should know that the entities in its dal are presented in the form of dataset. I had previously assumed that it was named "strongly typed" dataset. However, strictly speaking, such dataset cannot be called Typed Dataset.

Use truly to explain what is typed dataset:A strongly typed dataset is a custom object inherited from dataset. it can use its Exposed properties to perform strongly-Typed Access to encapsulated data.

Strong dataset avoids late field binding. A strong-type dataset provides a strong-type accesser, because it avoids searching for column names or table names in a collection, making access faster.

In addition to improving the running performance, the strong-type dataset also provides type checks, and can intelligently perceive fields through custom Field Names during design.

In my understanding, typed dataset should be1. inherit from a class of the dataset class;
2. provide direct access to the basic attributes of the architecture of the data stored;
3. It should include the object definition of the secondary container and support for direct access (that is, datatable & datarow );
4. developers can write data access code more efficiently.

I personally think that the last point above is the key to Typed Dataset. Although truly pays attention to its performance difference from common dataset, I still think that typed dataset is very large.Simplified the task of data navigation and Operation.

Application of Typed Dataset

I didn't want to discuss the application of this item, because to tell the truth, I don't think I am qualified. I don't have many applications for typed dataset, on the one hand, it is also because I think such a class is very bloated for me, not to mention the generated code, the memory occupied by it allows me to use it as an excessive data storage object to some extent. More often, my object class is generated using a self-written tool.

But as far as I know, M $ recommends that developers use dataset/Typed Dataset. Indeed, when everyone is talking about Orm, dataset provides a simple or lightweight o/R mapping mechanism, the strong dataset gives full play to its strengths.

In fact, to describe the application of a strong dataset, we first think of some common dataset applications. I have seen some friends who rely heavily on DataSet and use it as a golden key to process/store data, it is not even "retained" as the method for saving the status (it exists in the session, and so on ). In fact, it turns into "Abuse" to a large extent ".

Duwamish should be appropriate for dataset applications. Although I said its dataset is not purely typed dataset, it does have some basic conditions as a strong type. For the most e-commerce site, the relationship between the data contained in it is relatively simple and the logic is very clear. In this case, if we perform Object Modeling on books, shopcart, order, and so on, using a pure oo idea to do such a website seems a bit to reflect the "advanced technology", and the appearance of dataset has improved a lot in efficiency, although the Code of the entire website contains some demo meanings (the architecture demonstration of N-tier), it is clear in terms of data processing and operations, and the code efficiency is also relatively high.

Typed Dataset Deficiency

This is purely my own experience. As mentioned above, the Code generated by vs.net is very bloated, although it does not affect its use, however, it is not very convenient to customize the description and extension of this strong-type dataset. If you want to write it manually, it seems that you have the original intention of improving development efficiency. In fact, in addition to using vs.net IDE, you can also use the writexmlschema method of dataset to collaborate with the XML tool provided by the dotnet sdk to create a strong-type dataset, but it is still a little troublesome after all.

Summary

These are some of my personal understandings. Since dataset has not been used for a long time, although I have tried some research in this area before, it is inevitable that the expression is not comprehensive enough or there are some misunderstandings, please give me more advice.

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.