Recently, we developed an internal software development and management system using ASP. NET. This is the first time we used ASP. NET, and the language is C #. Next I will focus on the architecture of our system. Please give me some advice.
First, let's talk about the background of system development. The system is not large. The purpose of development is to manage the software development process of our company and learn. NET at the same time. Since it is the company's own system, it also has the purpose of learning, so in the system architecture, we also strive to complete and clear the structure, and put performance and other considerations in the second place. There are a lot of imperfections that are inevitable, and you can simply look at them with a critical perspective :)
The system is divided into four layers: (Web) presentation layer, (Facade) Business appearance layer, (Rules) business logic layer and (Data) Data layer. Each layer belongs to its own Project. Another Project is used to process common services. The Calling relationships between them are as follows: Web --> Facade --> Rules --> Data --> DB
The following describes the functions and features of each layer: The Data layer is called the Data layer, which is responsible for Data extraction and conversion. The Data layer inherits from the DataTable. A database ing relationship is established on it. That is to say, every field in the database has a constant associated with it. It encapsulates the Select, insert, and update methods. You can operate on a data table like a able. For example, you can call the Select method before taking the value, and then use oData. GetValue (I, alias of the database Field) to obtain the value. Before the Insert or Update operation, set the value with oData. GetValue (I, alias of the database field, and value), and then call the Insert or Update method. Through this layer, the database definition and upper-layer business logic are separated.
Data is above the Rules layer. The Rules layer is called the rule layer. What does it do? In fact, it is very simple. The Data layer is equivalent to a record set of the database. It may contain many records. The Rules layer splits the Data objects containing multiple records into multiple Rules objects and calls them to the Facade layer by providing attributes. At this layer, perform some processing and inspection operations according to the business rules. The previous layer can call different properties of the Rules object to obtain the corresponding processed value.
The Facade layer is called the business appearance layer, which is located on the top of the Rules layer. It is mainly responsible for the appearance processing of some businesses, organizing multiple Rules objects and providing display preparation for the Web layer.
The top layer is the Web presentation layer. It handles check and display controls on the page.
The above structure is also based on Microsoft's Duwamish 7.0. In addition, the names of each layer are exactly the same as those of Microsoft. In the specific implementation process, according to the above design, the Data and Rules layers are already quite regular, and the database definition is managed through another system of our company, the definitions of database tables and columns can be easily obtained. Therefore, we have created a small tool to automatically generate the Data layer and the Rules layer, this tool can automatically generate classes at the Data and Rules layers. All you need to do is enrich the classes at the Rules layer and process the Facade and Web layers based on your business, this greatly reduces our burden.
The system has completed the code test and is ready for trial. Because it is used on the enterprise intranet, it does not feel slow :). However, the performance is not good. The next step is to find a way to improve the performance.
In the process of development, I always compare it with JSP. Personal ASP. NET is still very good, it allows you to develop WEB programs like the desktop program development, Microsoft also provides a lot of controls, but many controls feel a bit like a chicken, it seems convenient to use, but it is not very practical to have all kinds of defects. In addition, the VS. NET development tool has many bugs because it is used for WEB Development (we use version 2003 ). However, it is said that VS. NET 2005 has improved a lot on the basis of 2003 and is worth looking forward.