Discuz!nt Forum Template Fundamentals

Source: Internet
Author: User
Tags interface modify net

The separation between the interface of the program and the business logic is now common sense, that is, the so-called MVC, it should be said that the control pattern in ASP.net has been implemented for the MVC pattern, but discuz! NT has chosen a different approach. This is mainly based on the following considerations:

1 acceptance of template makers. discuz! NT is a general-purpose products, users for the General forum Webmaster, each forum has its own interface personalized needs, so the production of interface template must be easy to be mastered by the general webmaster, and asp.net ascx file for those who have not learned asp.net or the development of the model did not understand the people, is difficult. discuz! NT allows users to understand HTML basic can make ASP.net forum interface, webmaster can easily master how to modify and design the interface.

2 Generally, the foreground program does not use control mode, performance has been improved. The control's development way is advantageous to enhances the development efficiency, enhances the module reusability, but the flaw is the performance to have some loss, for example does not need the data binding, obviously also does not have to judge the data source and the transformation data type, does not have the page control and the control event and so on, also avoids In addition, controls tend to be full-featured, and when you need only a fraction of the functionality, a lot of useless code can also drag on performance.

These two points are simply summed up to improve ease of use and performance.

discuz! The interface template method used by NT is similar to some other web programs, discuz! (PHP) in the way is to convert the template HTML file to php files, and then in the corresponding PHP program file #include in, another foreign asp.net program DNN is the HTML file translation for ascx files. discuz! The model of the NT can be considered as the former model and the level of Division (interface and business separation), can also be considered as the latter of the further (since those ascx is also automatically generated, why not simply aspx to make the first execution before the compilation simpler?)

discuz! The front page level of NT is as follows:


If it is still not clear, the file type can be visually described as follows:

The user's HTML template file is converted to an ASPX file when the template is selected in the background and is responsible for discuz! NT Front page display (e.g. showuser.htm is converted to showuser.aspx)

The Aspx.cs file is the page class, responsible for receiving user submissions, obtaining the various variables required by the page and "delivering" to the ASPX file, which is a major part of implementing the Forum's functionality (e.g. Showuser.aspx.cs provides variable-specific data for showuser.aspx)

For some commonly used forum objects, and business object encapsulation for easy to use (for example, the user's information encapsulated into the UserInfo class, users commonly used operations encapsulated in the Userfactory class)

Of course, in addition to the display layer, the other level of code is finally compiled into the DLL file, for the purely use of the webmaster, you generally only need to modify the display layer to meet your interface modification requirements.

The above is the approximate hierarchy, the details will be mentioned in the later chapters.



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.