ASP Framework Design

Source: Internet
Author: User
Tags config object model

One, overview

Easy access to ASP source code (if the DLL package is not conducive to virtual host deployment) so that the ASP source in the domestic prevalence of flooding, programmers tend to fast programming and fast forgetting, readability and maintenance are criticized by people. In fact, ASP code can also support "not thorough" object-oriented programming and modularity, the creation of the ASP framework to maximize the encapsulation of operations, optimize the code, facilitate maintenance and reading and to ASP.net integration or migration.

Second, design pattern

Because the ASP only supports the not thorough object-oriented idea, so many design patterns are not really implemented, can only be guided by the design pattern thought, in VBScript for implementation (can combine COM component technology) to write ASP frame framework.

1, DNA Architecture: ASP Framework is typical of Microsoft's DNA architecture, including the data layer (information), Business layer (business), Presentation layer (presentation) of the three-tier architecture, business layer is the entire application of the heart (core) part.

DNA (Windows distributed Internet Applications Architecture distributed Interconnect application Architecture):

(1), data storage layer (data): The Information Service layer provides the data source for the application. We can select Microsoftsqlserver, Oracle, or any OLE DB or ODBC-compliant data source as needed.

Use a relational database of more than medium size, using stored procedures, triggers. Database design must follow a consistent specification, designed to immediately write the appropriate stored procedures, triggers,

(2), Business Layer (business): The transaction logic layer is responsible for processing the application request of the presentation layer, completes the calculation task of the business logic, and returns the processing result to the user. The transaction logic processing layer separates the transaction logic originally placed in the C/S client, concentrates on the server part, and is shared by all users.

A, data access layer Dal (Access Layer): Responsible for accessing and controlling all databases, for ease of change can be temporarily written as a VBS class for encapsulation, after the background development and then encapsulated into COM + components. All users submit data to the DAL processing, such as form data or URL parameters, the background logic layer of other related processing must get the return value from the DAL, What you should do here is to get the request data--To do security processing--to check that the user data is canonical--the output return value.

B, Business logic layer (Business Logic Layer): It is recommended to encapsulate business activities of relevance into a VBS CLASS. such as the requirement to make an internal transfer platform, then there must be warehousing, out of the library, warehouse storage, summary and other operations, then the warehouse-related operations are sorted into a class, and then from within the class to call the above mentioned database processing layer of those to cooperate with the warehouse-related operations. In particular, consider the permission control layer: To support user groups and two-tier user roles (similar to the two-tier user role of Windows), or even the N-level inheritable user roles of large projects.

(3), Presentation layer (presentation): Is the Java Script (browser support friendlier) +xml can add htm,dhtml,scripting,javaapplet?,active x and other components of the user interface layer and the data transfer layer, A thin client is often used in an Internet environment to enable communication between the user and the application logic processing results. General background management of the user interface layer style is relatively fixed, you can use a unified package of a variety of forms, forms, statistical reports and other styles. And for the foreground of the user interface style is more changeable, you can use the UI framework for development, for large projects, should adopt a lightweight framework, JSVM is a good choice. The data Transfer Layer (Web page form) is responsible for preprocessing all the data submitted by the user, and is also responsible for receiving the lightweight data in the background output, and using jsax technology to obtain local information.

2,com Component technology: COM (Component Object Model) is equivalent to the business layer of this heart optional accelerator.

Business layer through the COM Component transaction processing, you can use VB (VC and C + +, etc.) to create user components, can be the same business logic of the page and logic into a class, in different ways to implement. This allows you to take advantage of cheap memory to store a logically separate complex object, thereby reducing the use of expensive resources, such as database links. For code and database security, and for the development of company security, the core business layer is generally required to compile into DLL components. and the Business Layer COM component development and testing work, and according to the needs of business logic in the refined ASP scripting language to select and use COM components of the work to achieve a division of labor. This is beneficial to the standardization and reuse efficiency of the components.

IIS (Internet Information Server) is responsible for managing business-level Web pages, and MTS (Microsoft Transaction Server) is responsible for the unified management of business-level COM components. MTS implements the monitoring of distributed connection management, thread pool automatic management and high-performance transaction processing for COM components under multithreading support. The database is no longer connected to each active customer (in the C/s two-tier architecture), but several customers reduce the number of connections by applying logical components to share the database, and MTS's security management mechanism can delegate specific components to different groups of users by permissions. Improve the performance and security of the data server.

You can use the simple configuration of XML's provisioning application to establish a loose link between ASP pages and components. With this connection, the application can be divided, disassembled, and assembled in a very casual and relaxed manner. This idea can also be borrowed from the struts-config.xml and asp.net in MVC struts and web.config.

3, Access's similar SQL stored procedures encapsulation: ACCESS2000 in the AC library to pass the parameters of the query, so you can use similar to SQL stored procedures to encapsulate the SQL statements in the ASP to the query, directly using the Adodb.command object to invoke the return value. Although the method is currently inefficient, it is possible to detach the operation of the database from the program. Realized: The display layer, the logic layer, the database operation layer completely separates.

Related Article

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.