Contact Discuz! NT architecture: Excellent Architecture facilitates website integration and secondary development

Source: Internet
Author: User
Tags forum software
Considering users' actual application requirements and future-oriented software development concepts, Discuz! NT built an excellent architecture at the beginning of design and development, greatly improving the scalability, scalability and reusability of the software.. In addition to Discuz! The NT structure is clearer and easier to maintain. It also provides great convenience for users to conduct secondary development and improve Forum personalization.

Discuz! NT adopts the following layer-4 structure. Let's briefly introduce it:

(1) display Layer

The display layer can be designed and modified by the user to display the final web page interface and Forum data. It is particularly worth mentioning that Discuz! NT did not select the control mode used by the vast majority of ASP.net programs at the front end, but also implemented a convenient and easy-to-use template mechanism. This template allows webmasters to use html (or xhtml) to create templates, which are then created by Discuz! The template Conversion Function of NT is converted to the Asp.net page program (that is, aspx) file, which has two advantages:

1) Improved ease of use:ASP.net's ascx file is difficult for those who have not learned ASP.net or have no idea about its development mode, and Discuz! The template mechanism of NT makesUsers only need a simple understanding of html to create an ASP.net Forum interface. The Webmaster can easily and freely design and modify the interface.

2) improved performance:In general, foreground programs do not use the control mode.Use Discuz! The template Conversion Function of NT will significantly improve the performance. For example, Discuz! The template Conversion Function of NT does not require data binding, does not need to judge the data source and convert the data type, does not need page controls, avoids the use of ViewState, thus greatly improving the page performance. In addition, the control mode is often designed to provide complete functions. When you only need some of the functions, a large amount of useless code will drag down the page performance.

What's more, Discuz! The NT display layer is highly flexible. It supports defining the imported namespace and inserting c # code in the template, so that the display layer can easily insert data from other sets.

(2) page Data Processing Layer

Discuz! The page Data Processing Layer of NT is mainly responsible for processing data input and output on the web page, including checking the validity of user data submission and the data source required by the page program. This layer implements the main requirements of the Forum and completes the functional processes of each page on the foreground. For example, when a user posts a post, the page data processing layer first judges the user permissions and then checks whether the data submitted by the user is valid, finally, call the method in the encapsulation class of the corresponding business object to actually store the user data.

If the webmaster wants the user to interact with other programs at the same time during input and output at the front end, the user can perform processing at this layer.For example, a phishing enthusiast website wants to be in Discuz! You can add the fishing rod category option to the personal data of NT users and store it in the user information database of the primary website. Then, you can add the fishing rod category in the front display layer, and then in the page data processing layer, call the method of storing the data into the user information database of the primary website to complete the storage.

Discuz! The page Data Processing Layer of NT can access the database, but it is not recommended that developers increase interaction with the database at this layer. The database access is in the Business Object encapsulation layer to be introduced below.

(3) Business Object encapsulation Layer

For forums, users, themes, posts, forum, user groups, and so on all belong to the category of business objects. Discuz! NT describes Business Objects as object classes and provides a variety of methods to perform various operations on these objects. For a topic object, you can create, modify, delete, and update a topic in the encapsulation method. Discuz! NT uses these methods internally to process topics. Similarly,Developers can also directly call these methods to implement Discuz! The specific operation of NT, instead of having to operate the database on its own.

(4) database access layer

The database access layer encapsulates access methods for different databases. Currently, Discuz! NT has Access encapsulation for Access and SQL Server databases respectively. For SQL Server users, you can also modify Discuz! NT database stored procedures to efficiently meet some specific needs.

The Discuz! The four-layer structure of NT. In general, the Forum is like a hotel. Forum visitors are guests; the display layer is the dining table and Hall of the hotel, so that guests can eat. The page data processing layer is a waiter, the customer is responsible for receiving the food from the guests and placing orders with the cook. The Business Object encapsulation layer is the cook, which is responsible for preparing the dishes and returning them to the waiter. The database access layer is the purchaser who purchases the raw materials required by the cook;The structure serves as a hotel process or rules and regulations. By improving the division of labor and collaboration among all members, the structure gives the guests a Good dining environment and service.

In addition, whether the developer is using c #, vb.net, or any other language that supports. net, you can directly call the public methods in the above four layers to implement Discuz! NT call. With Discuz! With the improved open source, more and more developers will be involved in the development. I believe that with our joint efforts, Discuz! NT will be improved.

Discuz! NT Forum: http://nt.discuz.net/showtopic-11724.html

Series of articles:

Contact Discuz! NT inheritance: inheritance of Discuz! Advantages: the launch of the. NET Forum

Contact Discuz! NT Open Source: free open source code and user growth

Contact Discuz! NT platform: Adapt to ASP. NET platform to replace ASP forum software

Contact Discuz! Functions of NT: powerful functions, novel details, more considerate Design

Contact Discuz! NT architecture: Excellent Architecture facilitates website integration and secondary development

Contact Discuz! Management of NT: Community Desktop client webmaster management new utility

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.