Community Server Topic 1: Overview Community Server
Community Server (CS) is an excellent open-source Asp.net software. Currently, the officially released system includes three parts: Asp.net Forums, DotText, and Gallery. If you are a member of a website structured with CS, you can easily have a Blog, an album, and discuss it with others on the forum, in this way, a User-centered Community is formed, that is, the meaning of the Community Server.
The CS architecture is clever. The three different open-source software are combined with Telligent Systems for unified user management and permission settings (Menbership), unified Exception Handling, unified localized resource management (multi-language implementation) and so on. Although this cannot be fully regarded as a Portal implementation, it is very modular from the code point of view. It can be quickly expanded while achieving good performance. To implement these functions, we mainly rely on two projects in the project: CommunityServerComponents and CommunityServerControls.
CommunityServerComponents contains some global business logic classes, such as Globals and Context, some interfaces and parent classes used for inheritance, such: group, Section, Thread, Post, and other entity classes that implement Membership. Exception Handling and Url Rewrite are implemented by inheriting the IHttpModule interface. Of course, you must configure the IHttpModule inheritance. In this project, some global configurations are implemented through CSConfiguration. HttpHandler is also used to process nonexistent URLs. For example, HttpHandler is used to read user portraits. Cache is one of the most effective ways for Web programs to improve their running efficiency. In this project, it is mainly in the CSCache class. There is no deep code in this class. It is mainly used to package cache methods, it is then managed globally.
CommunityServerControls focuses on the business logic of the UI, including many common user-defined controls, typical of which are Editor, ResourceLabel, resourceLabel is usually displayed on the web pages of several projects. Another important purpose of this project is to provide the Skin function. TemplatedWebControl provides the Skin base classes for Forums, Blog, and Gallery projects. Of course, if you expand CS to add your own project, also need to inherit TemplatedWebControl, the specific implementation of skin replacement will be subject to a separate introduction, Asp.net Forums the original skin replacement is the full name of the skin (such as: Skin-PostView.ascx ), however, in the current project, you do not need to provide the full name. Only the "Skin-{0}" is provided in the base class }. ascx ", and then use GetType (). name is {0}, and the combination is the full Name. That is to say, as long as the class name of the Skin class needs to be extended and the {0} Name of the Skin is the same, the corresponding Skin can be automatically found, and a small improvement is much easier. CS uses Membership for unified user and permission management, and user and permission management serves as the basis for all extended projects. Therefore, CommunityServerControls implements the Membership UI business logic.
CommunityServerForums, CommunityServerGalleries, and CommunityServerBlogs are implemented by three application projects. The three layers are implemented through a large number of inheritance and abstraction. CommunityServerGuestBook is a simple extension project. You can analyze the code and find that the CS extension is very easy and efficient.
CS also has some excellent designs in the database. For example, if you use all stored procedures, many experts will tell you that it is irrational to use all stored procedures in projects, but CS does. The key point is that he has a SqlGenerator class and some xx Query classes which can generate SQL Text (mainly some variable Search and Post queries) as required ), the SQL Text is passed in as a parameter of the stored procedure, and then execute it using EXEC to get the desired result. SQL Text is more flexible than stored procedures, but it is prone to vulnerabilities that are finally exploited to launch SQL injection attacks. CS provides two methods. Of course, this requires more time to write code. In addition, data is read by page using stored procedures.
The CommunityServerWeb Project is a collection of all webpage html, resource files, configuration files, and js files. The project itself has no logic code. The analysis mainly involves the structure and arrangement of directories.
CS is closely related to Asp.net 2.0. Membership, Localization, MasterPage, and Url Rewrite are familiar words in Asp.net 2.0. You can easily see their implementations in CS, not just using them, you can see how they are implemented through code.
After talking about many advantages, let's talk about the disadvantages: Because CS was formerly called Asp.net Forums, we can easily see the residual shadows of Forums in the current version, if you do not understand the development of the development, some variables will make you confused. In addition, some code in the basic architecture also falls together with Forums, but I want to follow the next version, or the next version of CS will be more attractive. I hope to add more features such as WebPart when the next version of CS is released.
You can download the source code from the address below: http://communityserver.org/
Official station http://communityserver.cn/Chinese site initiated by Baoyu