I used to develop a small and medium-sized enterprise website, it is tend to use a clear and simple direct translation code to develop (ASP or PHP), which can shorten the development cycle, and two afterwards are easy to modify. I don't even have a embarrassing situation that I can't understand, I do, I still use this fast and effective way to develop a small project.
But if you encounter a complicated network application such as MIS system, ERP, etc., it seems that it is a bit of power. It is often encountered some security in the system of security, the database replacement, and the number of code written, which are almost unable to extends. In the process of finding how to solve these troubles, I found that the distributed N-layer structure of the ASP.NET architecture is developed to effectively solve the above problems.
The essence of scalability and reusable constructing distributed N-layer structural network applications is to separate business logic (BLL) and database access logic (DAL) in the program into two separate components. This makes your code easier to maintain, and the adaptability is also stronger. For example, if you want to change the database from SQL Server to Oracle, it will be easy. You only need to replace the data access logic layer, and many other developed business logic programs can run without modification. The same reason, if you want to transfer the developed system from a B / S structure web application to a desktop EXE version, you only need to re-develop a business logic layer (BLL) component that can be called by EXE version. Yes. Of course, using this distributed N layer structure also has many "reusable" excellent features ..., for example, you can put your business logic component (BLL) in your server cluster (if you have ) To handle more requests. At the same time, using this distributed structure is developed, which is conducive to our responsibility and task in the team, so that more people can participate in the development project.
Data read-write security and performance optimization At the same time we can also use the benefits such as stored procedures ... such as stored procedures ... and other means in the database access logic (DAL). Its advantage is mainly in the following aspect:
· Safety: Generally, we are writing the account and password in the code when using the ASP write database. This is easy to disclose to third parties. After using the stored procedure, we set the database to only open to the user. The data read and writes of the process, which avoids the possibility of data being directly read or written. · Optimization of performance: Since the stored procedure is precompiled, the query optimizer analyzes, optimizes, and gives the plan in the final presence system table when the stored procedure is precompiled. · Scalability: Developed data fixtures, which can be called multiple times, and can also be called by programs developed by other languages. These I have developed some of the experiences developed by the .NET architecture, released here, just to throw bricks, I hope to get the guidance of peers. I believe that in terms of program design structure, data reading and writing is more scientific and effective development techniques. Welcome friends who are also interested in this area to communicate with me, and improve together!