Orm is a tool that increases the development speed.

Source: Internet
Author: User
Tags spl

I also came to join me when I was talking about ORM recently in the garden. I have used ORM tools such as SPL, nbear, and subsonic. SPL is very nice when I use it for the first time. When I add records, I no longer need to write them to database fields one by one. Writing database access is also very easy. You don't need to close the link and open the link. It is really convenient. I made two projects with SPL, so I was very happy to use it. Next, I will issue a question. XML is dangerous to save the database structure ing. Although there is a solution, it is not so cool. Later, I saw the nbear in the yard. The first time I came into contact, I felt great. I directly designed the class and then generated the tables in the database. It was good. Unfortunately, I learned a week and used it in a project to find a problem. In actual projects, it is unlikely that the class design can be improved for a long time at the beginning of the project, most of the systems are improved while running, while nbear drops the table and returns it again. Although there are solutions, it is a pity that there is not so much time for further research. In addition, nbear seems to have been updated for a long time. Later, I heard a friend from the group say that subsonic is good. I watched the subsonic video on the official website. It is really easy to get started. Common additions, deletions, and changes are handled very well, I decided to use this developer one morning. Nhib.pdf has also seen it for a few days, and it seems a little slow to get started. It is a little troublesome to configure and give up. When using these ORM tools, I feel very uncomfortable. Each ORM has its own query syntax. Simple query of a single table is good, and it feels good to use it. In my opinion on complex multi-table queries, don't do this with the ORM tool. Mistaken, complex queries use SQL scripts, or stored procedures, which should be handed over to professional database staff for better performance.

My Criteria for Evaluating good or bad ORM tools:

    1. Is it helpful for your work.
    2. The learning cost is not high. If the learning cost is too high, give up.
    3. It is convenient to add, delete, and modify basic databases.
    4. Not Supported. You can directly write SQL scripts.
    5. Supports multiple databases (SQL, Oracle, MySQL ).
    6. It is best to open source for free.

After I use the ORM tool, the system architecture (web project) is used ):

 

Note: The ORM tool generates a dbmodel. Based on the project requirements, it constructs the objects designed to be used in some projects into multiple tables, and encapsulates the addition, deletion, modification, and encapsulation of complex objects. The search layer is specially designed for complex queries and batch database operations. Easy to call on the web. Dal I use subsonic. It uses the Microsoft Enterprise Library at the underlying layer, and supports multiple database types. In this structure, all services are called for the web.CodeConcise. Search and usermodel are customized based on the characteristics of each project.

In actual project development, each project has its own characteristics. You must use the appropriate method based on the characteristics of the project. Object-Oriented Programming and process-oriented programming, depending on the actual situation, I feel it is best to combine the two methods, which is simple, when it is not easy to change, it is not impossible to use the process-oriented encoding method. The process-oriented programming method can handle a considerable amount of problems and the amount of code is relatively small. Object-Oriented Programming is often used in areas that change. Each method has its own advantages and disadvantages. There is no need to talk about the process-oriented and object-oriented. Who can solve the problem faster and better. Grandpa Deng is right. Don't worry about the white cat and the black cat. It's a good cat to catch a mouse! What suits you is good!

You are welcome to make comments.

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.