Development of enterprise Management system in multi-layer architecture under. Net

Source: Internet
Author: User
Tags config include interface key words connect
Architecture SummaryWith the release of. NET 2.0, it is increasingly convenient to build enterprise management systems with multi-tier architectures under. Net. This article takes a foreign trade company's management system as the background, introduces in. NET platform, the Enterprise management system is constructed with multi-layer architecture.

   Key Words. NET; Unit test; b/S architecture

   Introduction

The. NET framework is a new generation development platform developed by Microsoft. Allows applications to communicate and share data over the Internet, regardless of which operating system, device, or programming language is in use. The management system described in this article is in the. NET platform to develop the idea of extreme programming, using object-oriented development, b/s architecture, ASP.net, C # and automated testing tools csunit.

   Problem Analysis

This system is developed for a foreign trading company, which manages the purchasing, sales, inventory and other trade links. The company is abroad, its suppliers are at home, while the clients are foreign companies. Companies, suppliers, customers can now connect the Internet, the company has a local area network, mainly through ADSL high-speed Internet connection.

After a careful analysis of the company's business needs, we believe that the entire system should include the following functions: to communicate with suppliers in a timely manner, and to track the progress of the supplier's product production, after receiving the products from the supplier, you can inventory management of these products, and keep abreast of the product inventory status To communicate with customers in time, and to track the status of orders sent to customers, to control the user's rights, improve the controllability and security of the system, the new system to interface friendly, faster data transmission, ease of use and scalability, and so on.

   System Development Description

According to the previous system requirements and functional analysis, the system is mainly divided into the following parts:
  
⑴ Basic Setup Management: Includes Personnel management modules--for building and maintaining user systems, corporate management modules--maintaining system-related customer and supplier information, product management-adding, modifying, deleting, and querying product information.

⑵ Supply Management System: Because the company's suppliers mainly in the domestic, the system uses the Chinese language interface, including the purchase Order Management module, Production Schedule management module, delivery batch Management module, report Management module and Exchange Information Management module.

⑶ Sales Management System: This subsystem is responsible for communication with customers, including Customer Inquiry management module, customer Order Management module, Production information query module, quality feedback system and report management module.

⑷ Inventory Management System: The company's inventory maintenance, including the Warehouse basic setup module, warehouse product Management module, report management module.

The system uses the three-tier architecture, the database uses Microsoft SQL Server2000, the programming language is C # and ASP.net, the Web page uses asp.net, codebehide code, the Backstage program is written by C #. In addition to the Web presentation layer, there are model layer, data access layer DAL, business logic layer BLL, Automated test layer UT, and so on.

DAL is responsible for data access to the database, BLL by invoking the method of the DAL layer to achieve business requirements, the Web layer by calling the BLL method to achieve interaction with the user, the UT layer is responsible for the model layer, the DAL layer and the BLL Layer Unit test, model provides data entity classes for Web, BLL, Dal invocation, the relationship between the layers is shown in Figure 1:


Figure 1


DAL is responsible for the interaction with the database, in order to improve maintenance, using OOP design ideas, only the BLL layer can directly call the method in the Dal layer class, can not be called across layers. The connection field information for the database is placed in the Web.config file, for example: To connect to the SQL Server database, set as follows:

<add key= "mssqlconnstring" value= "server=" (local); User Id=sa; Password=pwd;
Database=dbent "/>
For the DAL, data access may be frequent, database connections and shutdown operations are frequently required, so the system does not adopt ado.net and returns data using DataReader objects to improve application performance and reduce system overhead. Examples are as follows:

public static SqlDataReader ExecuteReader (String connstring, CommandType cmdtype, String cmdtext, params sqlparameter[] C Mdparms)
SqlCommand cmd = new SqlCommand ();
SqlConnection conn = new SqlConnection (connstring);
Try
{
PrepareCommand (CMD, conn, null, Cmdtype, Cmdtext, cmdparms);
SqlDataReader rdr = cmd. ExecuteReader (commandbehavior.closeconnection);
Cmd. Parameters.clear ();
return RDR;
}
Catch
{
Conn. Close ();
Throw
}
}
The functions of BLL layer mainly include sales management, purchasing management, Inventory management, basic setup management, product management, quality management, financial management and so on, and the complex business logic is realized by many different classes.

The UT layer is responsible for unit testing of the BLL, Dal, and model, and writes the unit test class, followed by XP and TDD, to begin writing the class method. Through testing to guide the development of program code, Unit test through is the completion of the class method. UT layer structure similar to DAL,BLL, for different classes to establish the corresponding Test unit class. The structure of UT is shown in Figure 2:

The web layer is a direct interaction with the user level, through codebehind code, this layer directly calls the BLL layer method to achieve the user's business needs, and the results are displayed on the Web page. Because the company server is in London, but many users are not in the UK, the issues to consider include:

⑴ security is set for security in Web.config, even when a user logs on to the system, some Web pages must have specific permissions for users to browse, and for parameter passing between pages, hyperlinks are not appended with any parameters.

⑵ speed to take into account a part of the user's Internet speed is slow, bandwidth is insufficient, for large quantities of data display as far as possible in the way of paging.

⑶ usability because a lot of users are not computer professionals, so the system is easy to use and fast, such as: for multiple input boxes of data input, can be entered through the return key between the different input boxes to facilitate user action; For an internal management system, because the original customer has been using access systems, The new system is required to have higher self-learning ability, as far as possible refer to the original system.


Fig. 2 The structure diagram of UT


   Concluding remarks

This system development time is 12 months, the development personnel is 5 people. The database uses more than 50 library tables, development tools for Visio Studio 2003, and open source tools Csunit as unit test tools. In a multi-tier architecture development model, different developers are responsible for different layers and can focus on their own parts. For example: the person responsible for the Web page can concentrate on the design of the interface, the person responsible for the DAL layer mainly consider the interaction with the database, as for the business needs of the people responsible for the BLL layer. Through the layered mode, the maintenance of the system is improved greatly, and the development speed is also accelerated. As can be imagined, along with Microsoft. NET strategy, the development pattern of multi-layer architecture under. NET will become more and more popular.

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.